From b39f872a41b92a31589052c8f914c5b52f206fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sat, 30 Jul 2011 11:45:15 +0200 Subject: [PATCH] Limit fsize before adding to pointer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids a theoretically possible pointer arithmetic overflow which would lead to a crash due to reading from NULL page. Signed-off-by: Reimar Döffinger --- libavformat/aacdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index ded11b6854..c3a5029260 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -47,6 +47,7 @@ static int adts_aac_probe(AVProbeData *p) fsize = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF; if(fsize < 7) break; + fsize = FFMIN(fsize, end - buf2); buf2 += fsize; } max_frames = FFMAX(max_frames, frames);