This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 4968cc472b724e52fc9fd405877f367b42db92cf Author: Michael Niedermayer <[email protected]> AuthorDate: Sat Oct 10 07:19:58 2026 +0200 Commit: michaelni <[email protected]> CommitDate: Thu Nov 5 23:03:11 2026 +0000 avcodec/mjpegdec: set the AVID frame height and cropping before flipping Fixes: heap-buffer-overflow (read) Fixes: NzELYSvufGfQ Fixes: ANT-2026-324B3XNF Fixes: ant-324b3xnf-avrn-64x32-flipped.avi Found-by: Claude and Ada Logics Out of array read Replicated through UnModified FFmpeg with ASAN --- libavcodec/mjpegdec.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 8002ca191a..df46b2b8dc 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2797,6 +2797,14 @@ the_end: } } } + if (avctx->codec_id != AV_CODEC_ID_SMVJPEG && + (avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || + avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && + avctx->coded_height > s->orig_height) { + frame->height = AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres); + frame->crop_top = frame->height - avctx->height; + } + if (s->flipped && !s->rgb && !s->bayer) { ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &hshift, &vshift); if (ret) @@ -2921,14 +2929,6 @@ the_end: av_log(avctx, AV_LOG_WARNING, "couldn't attach EXIF metadata\n"); } - if (avctx->codec_id != AV_CODEC_ID_SMVJPEG && - (avctx->codec_tag == MKTAG('A', 'V', 'R', 'n') || - avctx->codec_tag == MKTAG('A', 'V', 'D', 'J')) && - avctx->coded_height > s->orig_height) { - frame->height = AV_CEIL_RSHIFT(avctx->coded_height, avctx->lowres); - frame->crop_top = frame->height - avctx->height; - } - the_end_no_picture: av_log(avctx, AV_LOG_DEBUG, "decode frame unused %td bytes\n", buf_end - buf_ptr); -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
