From 3a91eb37c496099df24e25a42b561028cb56bb6c Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 7 Nov 2019 21:16:32 +0100 Subject: [PATCH] avformat/mp3dec: Check that the frame fits within the probe buffer Signed-off-by: Michael Niedermayer (cherry picked from commit e9a335150a62bb377a26ce096187b4476145d02b) Signed-off-by: Michael Niedermayer --- libavformat/mp3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 258f19174b..6848415657 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -91,7 +91,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;