ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Mon Jul 28 20:45:59 2025 +0200| [3ccd7d8c8e85aaae0c6d6cc88ea6cb5309d56cdc] | committer: Michael Niedermayer
avcodec/sanm: Check decoded_size for old_codec48 Fixes: writing over the end of the array Fixes: BIGSLEEP-434637586/payload Regression since: b22ce90d42 Found-by: Google Big Sleep Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ccd7d8c8e85aaae0c6d6cc88ea6cb5309d56cdc --- libavcodec/sanm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 02bb78859a..617b977ab7 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -1601,6 +1601,11 @@ static int old_codec48(SANMVideoContext *ctx, int width, int height) } break; case 2: + if (decoded_size > ctx->buf_size) { + av_log(ctx->avctx, AV_LOG_ERROR, "Decoded size %u is too large.\n", decoded_size); + return AVERROR_INVALIDDATA; + } + if (rle_decode(ctx, &ctx->gb, dst, decoded_size)) return AVERROR_INVALIDDATA; break; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".