mpjpegdec: fix memory leak in probe function
authorJames Almer <jamrial@gmail.com>
Mon, 8 Jun 2015 19:02:30 +0000 (16:02 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 8 Jun 2015 19:03:31 +0000 (16:03 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/mpjpegdec.c

index 8a05c9b..7075c83 100644 (file)
@@ -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;