From 3ff5fa03885493eb560370b0afb32a9e6483ef4b Mon Sep 17 00:00:00 2001 From: Pu Cheng Date: Sun, 22 Nov 2026 16:59:12 +0800 Subject: [PATCH] decoder: Clear sequence display extension flag on each sequence header u1_seq_disp_extn_present is set when a sequence display extension is parsed and was cleared only at init and on reset. If a stream has a second sequence header that is not followed by a sequence display extension, IMPEG2D_CMD_CTL_GET_SEQ_INFO kept returning the video format, colour description and display size of the earlier sequence instead of the unspecified values. Clear the flag when a sequence header is parsed, so it only reflects an extension that follows the current sequence header. --- decoder/impeg2d_dec_hdr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/decoder/impeg2d_dec_hdr.c b/decoder/impeg2d_dec_hdr.c index c42fb54..9fbab5a 100644 --- a/decoder/impeg2d_dec_hdr.c +++ b/decoder/impeg2d_dec_hdr.c @@ -157,6 +157,7 @@ IMPEG2D_ERROR_CODES_T impeg2d_dec_seq_hdr(dec_state_t *ps_dec) } impeg2d_bit_stream_flush(ps_stream,START_CODE_LEN); + ps_dec->u1_seq_disp_extn_present = 0; u2_width = impeg2d_bit_stream_get(ps_stream,12); u2_height = impeg2d_bit_stream_get(ps_stream,12);