This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new ed27b2c498 avcodec/mjpegenc: flip AMV pictures starting from the last
row of each plane
ed27b2c498 is described below
commit ed27b2c498e343cd68f2871da535c2a37525087b
Author: Michael Niedermayer <[email protected]>
AuthorDate: Tue Sep 15 06:13:53 2026 +0200
Commit: michaelni <[email protected]>
CommitDate: Fri Sep 25 15:06:17 2026 +0000
avcodec/mjpegenc: flip AMV pictures starting from the last row of each plane
Fixes: out of array read
Fixes: XuzTudm0onFG
Found-by: Zheng Yu @ Depthfirst
---
libavcodec/mjpegenc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index ee70e17bcd..b9ebe3d769 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -609,8 +609,6 @@ static av_cold int mjpeg_encode_init(AVCodecContext *avctx)
}
#if CONFIG_AMV_ENCODER
-// maximum over s->mjpeg_vsample[i]
-#define V_MAX 2
static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic_arg, int *got_packet)
{
@@ -633,8 +631,8 @@ static int amv_encode_picture(AVCodecContext *avctx,
AVPacket *pkt,
return AVERROR(ENOMEM);
//picture should be flipped upside-down
for(i=0; i < 3; i++) {
- int vsample = i ? 2 >> chroma_v_shift : 2;
- pic->data[i] += pic->linesize[i] * (vsample * s->c.height / V_MAX - 1);
+ int v_shift = i ? chroma_v_shift : 0;
+ pic->data[i] += pic->linesize[i] * (AV_CEIL_RSHIFT(s->c.height,
v_shift) - 1);
pic->linesize[i] *= -1;
}
ret = ff_mpv_encode_picture(avctx, pkt, pic, got_packet);
--
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]