avformat/mp3dec: Check that the frame fits within the probe buffer
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 7 Nov 2019 20:16:32 +0000 (21:16 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 16 Nov 2019 22:38:43 +0000 (23:38 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mp3dec.c

index 6888c88..4fde920 100644 (file)
@@ -89,7 +89,7 @@ static int mp3_read_probe(const AVProbeData *p)
 
             header = AV_RB32(buf2);
             ret = avpriv_mpegaudio_decode_header(&h, header);
-            if (ret != 0)
+            if (ret != 0 || end - buf2 < h.frame_size)
                 break;
             buf2 += h.frame_size;
             framesizes += h.frame_size;