This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 3ec0f14f7ddfb5067c18005f2fcc8c2348745c44
Author:     Jun Zhao <[email protected]>
AuthorDate: Sun Jun 7 21:17:40 2026 +0800
Commit:     James Almer <[email protected]>
CommitDate: Sun Jun 7 18:55:16 2026 +0000

    avcodec/h264_ps: set default SAR, remove stale workaround
    
    Set sps->vui.sar to {0,1} (unspecified) before the VUI parsing
    block, matching the HEVC pattern at hevc_ps.c.  The old
    zero-init-to-1 workaround is now unreachable and is removed.
    
    Suggested-by: James Almer <[email protected]>
    Signed-off-by: Jun Zhao <[email protected]>
---
 libavcodec/h264_ps.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index ac204172cb..e72d39ea8d 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -520,6 +520,11 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, 
AVCodecContext *avctx,
         sps->crop        = 0;
     }
 
+    /* SPS is zero-initialized; set the default unspecified SAR here so
+     * ff_set_sar() gets {0,1} when VUI is absent. decode_vui_parameters()
+     * overwrites it if VUI provides explicit SAR. */
+    sps->vui.sar = (AVRational){ 0, 1 };
+
     sps->vui_parameters_present_flag = get_bits1(gb);
     if (sps->vui_parameters_present_flag) {
         ret = decode_vui_parameters(gb, avctx, sps);
@@ -549,9 +554,6 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, 
AVCodecContext *avctx,
         }
     }
 
-    if (!sps->vui.sar.den)
-        sps->vui.sar.den = 1;
-
     if (avctx->debug & FF_DEBUG_PICT_INFO) {
         static const char csp[4][5] = { "Gray", "420", "422", "444" };
         av_log(avctx, AV_LOG_DEBUG,

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to