Commit 881404bf5d for ffmpeg
commit 881404bf5d878a3e11176165af77b4bfee73b4d9
Author: Peter Ross <pross@xvid.org>
Date: Sat Oct 31 07:23:49 2026 +1100
avformat/aiffdec: improved handling of unaligned chunks
Use dedicated variable for signalling an unaligned chunk. When an APPL
chunk is encountered, size is modified, so the size variable cannot be
later used as a reliable unaligned indicator.
Suggested-by: Kae
Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/25617
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 63194f2726..2a14d0b95c 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -265,6 +265,7 @@ static int aiff_read_header(AVFormatContext *s)
if (size < 0)
return size;
+ const int padding = size & 1;
filesize -= size + 8;
switch (tag) {
@@ -394,7 +395,7 @@ static int aiff_read_header(AVFormatContext *s)
}
/* Skip required padding byte for odd-sized chunks. */
- if (size & 1) {
+ if (padding) {
filesize--;
avio_skip(pb, 1);
}