[FFmpeg-cvslog] avcodec/cbs_av1: fix variable shadowing in cbs_av1_split_fragment()

Marth64 git at videolan.org
Tue Dec 24 23:42:49 EET 2024


ffmpeg | branch: master | Marth64 <marth64 at proxyid.net> | Wed Dec 18 20:17:35 2024 -0600| [8e8260aabf39c8c39eb99d5de9c21a76eb314747] | committer: Marth64

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 <marth64 at proxyid.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=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 be086b81cb..fea079379b 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;



More information about the ffmpeg-cvslog mailing list