[FFmpeg-cvslog] mpjpegdec: fix memory leak in probe function

James Almer git at videolan.org
Mon Jun 8 21:04:48 CEST 2015


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Jun  8 16:02:30 2015 -0300| [34d278f9838e355b3b2c7a9c0f77d7fcaf37ce49] | committer: James Almer

mpjpegdec: fix memory leak in probe function

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavformat/mpjpegdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index 8a05c9b..7075c83 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -88,7 +88,7 @@ static int mpjpeg_read_probe(AVProbeData *p)
         return AVERROR(ENOMEM);
 
     if (p->buf_size < 2 || p->buf[0] != '-' || p->buf[1] != '-')
-        return 0;
+        goto end;
 
     while (!pb->eof_reached) {
         ret = get_line(pb, line, sizeof(line));
@@ -102,6 +102,7 @@ static int mpjpeg_read_probe(AVProbeData *p)
         }
     }
 
+end:
     av_free(pb);
 
     return ret;



More information about the ffmpeg-cvslog mailing list