PR #20447 opened by Leo Izen (Traneptora)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20447
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20447.patch

Since 9dc79241d9680fc050376bb0cc37875a41d00cc9 we now always pop the
orientation off of the IFD and use a display matrix instead. This means
we should not produce a warning and refuse if the orientation field
indicates a default orientation (i.e. 1).

Signed-off-by: Leo Izen <leo.i...@gmail.com>
Reported-by: Ramiro Polla <ramiro.po...@gmail.com>


>From 3899fa1b53e0d3ba80ce8e26a19dfba66e449dc3 Mon Sep 17 00:00:00 2001
From: Leo Izen <leo.i...@gmail.com>
Date: Fri, 5 Sep 2025 11:44:41 -0400
Subject: [PATCH] avcodec/decode: treat orientation 1 as valid displaymatrix

Since 9dc79241d9680fc050376bb0cc37875a41d00cc9 we now always pop the
orientation off of the IFD and use a display matrix instead. This means
we should not produce a warning and refuse if the orientation field
indicates a default orientation (i.e. 1).

Signed-off-by: Leo Izen <leo.i...@gmail.com>
Reported-by: Ramiro Polla <ramiro.po...@gmail.com>
---
 libavcodec/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index f395948d60..ae86e270df 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -2337,7 +2337,7 @@ static int attach_displaymatrix(AVCodecContext *avctx, 
AVFrame *frame, int orien
     int32_t *matrix;
     int ret;
     /* invalid orientation */
-    if (orientation < 2 || orientation > 8)
+    if (orientation < 1 || orientation > 8)
         return AVERROR_INVALIDDATA;
     ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_DISPLAYMATRIX, 
sizeof(int32_t) * 9, &sd);
     if (ret < 0) {
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-le...@ffmpeg.org

Reply via email to