1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2026-06-19 19:03:00 +02:00

avcodec/on2avc: reject subframe count whose * SUBFRAME_SIZE product overflows 32-bit

Found-by: Anthropic agents; validated and reported by Ada Logics.
Signed-off-by: David Korczynski <david@adalogics.com>
This commit is contained in:
David Korczynski
2026-06-05 00:14:06 +02:00
committed by michaelni
parent 2576e09434
commit 331b3e9dea
+6
View File
@@ -866,6 +866,12 @@ static int on2avc_decode_frame(AVCodecContext * avctx, AVFrame *frame,
av_log(avctx, AV_LOG_ERROR, "No subframes present\n");
return AVERROR_INVALIDDATA;
}
if (num_frames > INT_MAX / ON2AVC_SUBFRAME_SIZE) {
av_log(avctx, AV_LOG_ERROR,
"Too many subframes (%d); per-frame sample count overflows\n",
num_frames);
return AVERROR_INVALIDDATA;
}
/* get output buffer */
frame->nb_samples = ON2AVC_SUBFRAME_SIZE * num_frames;