From 376e425c02ae3ead9137f1a7d019fe3b2f43343e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 11 Jan 2022 21:29:02 +0100 Subject: Fix T93588: some videos loaded flipped over Y axis on macOS Arm Was not actually flipping in the need_aligned_ffmpeg_buffer case. --- source/blender/imbuf/intern/anim_movie.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 1d81653c7cd..6a05b681c88 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -879,7 +879,7 @@ static void ffmpeg_postprocess(struct anim *anim) dst2, dstStride2); # else - /* Scale with swscale then flip image over Y axis. */ + /* Scale with swscale. */ int *dstStride = anim->pFrameRGB->linesize; uint8_t **dst = anim->pFrameRGB->data; const int dstStride2[4] = {dstStride[0], 0, 0, 0}; @@ -896,11 +896,12 @@ static void ffmpeg_postprocess(struct anim *anim) dst2, dstStride2); - bottom = (unsigned char *)ibuf->rect; - top = bottom + ibuf->x * (ibuf->y - 1) * 4; + /* Flip destination image buffer over Y axis. */ + bottom = (unsigned char *)dst[0]; + top = bottom + anim->x * (anim->y - 1) * 4; - h = (ibuf->y + 1) / 2; - w = ibuf->x; + h = (anim->y + 1) / 2; + w = anim->x; for (y = 0; y < h; y++) { unsigned char tmp[4]; -- cgit v1.2.3