From 2922cbdb14a69ca8f763182a9d70d13ddcdcd1ec Mon Sep 17 00:00:00 2001
From: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Date: Fri, 21 Mar 2008 10:47:14 +0000
Subject: [PATCH] cannot free AVStream like this, and return ENOMEM

Originally committed as revision 12529 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/mov.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6b4cf2a2465..70b059bb8d5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1204,10 +1204,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
     st = av_new_stream(c->fc, c->fc->nb_streams);
     if (!st) return -2;
     sc = av_mallocz(sizeof(MOVStreamContext));
-    if (!sc) {
-        av_free(st);
-        return -1;
-    }
+    if (!sc) return AVERROR(ENOMEM);
 
     st->priv_data = sc;
     st->codec->codec_type = CODEC_TYPE_DATA;
-- 
GitLab