[FFmpeg-cvslog] avformat/mpegtsenc: Use correct deallocation code on failure of pids array allocation

Michael Niedermayer git at videolan.org
Thu Aug 7 23:06:29 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Aug  7 22:40:24 2014 +0200| [12b59e57f3d7a37ef7b29d8a1df5eb886b00b4ba] | committer: Michael Niedermayer

avformat/mpegtsenc: Use correct deallocation code on failure of pids array allocation

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

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

 libavformat/mpegtsenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 5c0b0d7..5ecc7fb 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -623,8 +623,8 @@ static int mpegts_write_header(AVFormatContext *s)
 
     pids = av_malloc_array(s->nb_streams, sizeof(*pids));
     if (!pids) {
-        av_free(service);
-        return AVERROR(ENOMEM);
+        ret = AVERROR(ENOMEM);
+        goto fail;
     }
 
     /* assign pids to each stream */



More information about the ffmpeg-cvslog mailing list