From 3a375e3dcf09f8ac7dcf213160789ff96da88b7c Mon Sep 17 00:00:00 2001 From: Marth64 Date: Wed, 18 Dec 2024 20:17:35 -0600 Subject: [PATCH] avcodec/cbs_av1: fix variable shadowing in cbs_av1_split_fragment() header is previously declared as an int argument then shadowed in the scope of the loop as a AV1RawOBUHeader. Signed-off-by: Marth64 (cherry picked from commit 8e8260aabf39c8c39eb99d5de9c21a76eb314747) --- libavcodec/cbs_av1.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 458381f038..98d745f494 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -728,16 +728,16 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx, } while (size > 0) { - AV1RawOBUHeader header; + AV1RawOBUHeader obu_header; uint64_t obu_size; init_get_bits(&gbc, data, 8 * size); - err = cbs_av1_read_obu_header(ctx, &gbc, &header); + err = cbs_av1_read_obu_header(ctx, &gbc, &obu_header); if (err < 0) goto fail; - if (header.obu_has_size_field) { + if (obu_header.obu_has_size_field) { if (get_bits_left(&gbc) < 8) { av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid OBU: fragment " "too short (%"SIZE_SPECIFIER" bytes).\n", size); @@ -748,7 +748,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx, if (err < 0) goto fail; } else - obu_size = size - 1 - header.obu_extension_flag; + obu_size = size - 1 - obu_header.obu_extension_flag; pos = get_bits_count(&gbc); av_assert0(pos % 8 == 0 && pos / 8 <= size); @@ -763,7 +763,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx, goto fail; } - err = ff_cbs_append_unit_data(frag, header.obu_type, + err = ff_cbs_append_unit_data(frag, obu_header.obu_type, data, obu_length, frag->data_ref); if (err < 0) goto fail;