diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 61ef099f26..a42987c15f 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -243,7 +243,10 @@ static int aiff_read_header(AVFormatContext *s) if (size < 0) return size; - filesize -= size + 8; + if (size >= 0x7fffffff - 8) + filesize = 0; + else + filesize -= size + 8; switch (tag) { case MKTAG('C', 'O', 'M', 'M'): /* Common chunk */