[FFmpeg-cvslog] avformat/concat: revert one hunk of 20dfab33f5ab61fc51de65192ed239f8b62782a2

Michael Niedermayer git at videolan.org
Thu Sep 19 15:24:11 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 19 14:51:46 2013 +0200| [ad2a08388c82bdec5ac9355ca6e0bc4c98b26423] | committer: Michael Niedermayer

avformat/concat: revert one hunk of 20dfab33f5ab61fc51de65192ed239f8b62782a2

The deallocated memory contains resources that need to be freed before it
can be deallocated. The original code was correct.
This also fixes a double free

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ad2a08388c82bdec5ac9355ca6e0bc4c98b26423
---

 libavformat/concat.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/concat.c b/libavformat/concat.c
index 849b61a..5f8209b 100644
--- a/libavformat/concat.c
+++ b/libavformat/concat.c
@@ -111,9 +111,10 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags)
 
     if (err < 0)
         concat_close(h);
-    else if ((err = av_reallocp(&nodes, data->length * sizeof(*nodes))) < 0)
+    else if (!(nodes = av_realloc(nodes, data->length * sizeof(*nodes)))) {
         concat_close(h);
-    else
+        err = AVERROR(ENOMEM);
+    } else
         data->nodes = nodes;
     return err;
 }



More information about the ffmpeg-cvslog mailing list