[FFmpeg-devel] [PATCH 2/2] avcodec/evc_ps: Interpret a degenerate SAR as 1/1.

Giovanni Mascellani gmascellani at codeweavers.com
Tue Jul 30 16:11:49 EEST 2024


The specification doesn't say what should happen in this case.
Other implementations (e.g., Microsoft's Media Foundations) seem
to interpret this as 1/1.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 libavcodec/evc_ps.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/evc_ps.c b/libavcodec/evc_ps.c
index 637572d324..6c871e965e 100644
--- a/libavcodec/evc_ps.c
+++ b/libavcodec/evc_ps.c
@@ -87,6 +87,10 @@ static int vui_parameters(GetBitContext *gb, VUIParameters *vui)
         if (vui->aspect_ratio_idc == EXTENDED_SAR) {
             vui->sar_width = get_bits(gb, 16);
             vui->sar_height = get_bits(gb, 16);
+            if (vui->sar_width == 0 || vui->sar_height == 0) {
+                vui->sar_width = 1;
+                vui->sar_height = 1;
+            }
         }
     }
     vui->overscan_info_present_flag = get_bits(gb, 1);
-- 
2.45.2



More information about the ffmpeg-devel mailing list