avformat/flvdec: Check size at the top of the main loop

Fixes: signed integer overflow
Fixes: ffmpeg_flv_read_packet_libavformat_flvdec.c_1900_26.poc

Found-by: iceray-Li
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-05-18 23:37:12 +02:00
committed by michaelni
parent 84a48165f0
commit cc1459ed85
+4
View File
@@ -1565,6 +1565,10 @@ skip:
for (;;) {
int track_size = size;
if (size < 0) {
ret = FFERROR_REDO;
goto leave;
}
if (multitrack_type != MultitrackTypeOneTrack) {
track_size = avio_rb24(s->pb);