]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mpjpegdec.c
Merge commit 'c0b105756f61d253bdabcc2bb49453a2557e7c3b'
[ffmpeg] / libavformat / mpjpegdec.c
index 7075c838869c4f0ad4dae3c7c929057c1bf37dd2..845e95cb744fb85201fb71a05b96847717f21cb0 100644 (file)
@@ -83,13 +83,13 @@ static int mpjpeg_read_probe(AVProbeData *p)
     char line[128] = { 0 };
     int ret = 0;
 
+    if (p->buf_size < 2 || p->buf[0] != '-' || p->buf[1] != '-')
+        return 0;
+
     pb = avio_alloc_context(p->buf, p->buf_size, 0, NULL, NULL, NULL, NULL);
     if (!pb)
         return AVERROR(ENOMEM);
 
-    if (p->buf_size < 2 || p->buf[0] != '-' || p->buf[1] != '-')
-        goto end;
-
     while (!pb->eof_reached) {
         ret = get_line(pb, line, sizeof(line));
         if (ret < 0)
@@ -102,7 +102,6 @@ static int mpjpeg_read_probe(AVProbeData *p)
         }
     }
 
-end:
     av_free(pb);
 
     return ret;