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

Git pushed a commit to branch master
in repository ffmpeg.

commit 5962ca0c20c9380b87901301a3b7e747d30c7727
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Sat Feb 21 15:34:21 2026 +0100
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Tue Mar 10 13:52:18 2026 +0100

    avformat/avidec: Fix shadowing
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavformat/avidec.c | 50 ++++++++++++++++++++++++--------------------------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 8fb6931e5d..d7f8610628 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -377,15 +377,15 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t 
end)
         {
             uint64_t tag_end = avio_tell(s->pb) + size;
             while (avio_tell(s->pb) < tag_end && !avio_feof(s->pb)) {
-                uint16_t tag     = avio_rl16(s->pb);
-                uint16_t size    = avio_rl16(s->pb);
+                uint16_t tag2     = avio_rl16(s->pb);
+                uint16_t size2    = avio_rl16(s->pb);
                 const char *name = NULL;
                 char buffer[64]  = { 0 };
                 uint64_t remaining = tag_end - avio_tell(s->pb);
-                size = FFMIN(size, remaining);
-                size -= avio_read(s->pb, buffer,
-                                  FFMIN(size, sizeof(buffer) - 1));
-                switch (tag) {
+                size2  = FFMIN(size2, remaining);
+                size2 -= avio_read(s->pb, buffer,
+                                   FFMIN(size2, sizeof(buffer) - 1));
+                switch (tag2) {
                 case 0x03:
                     name = "maker";
                     break;
@@ -400,7 +400,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
                 }
                 if (name)
                     av_dict_set(&s->metadata, name, buffer, 0);
-                avio_skip(s->pb, size);
+                avio_skip(s->pb, size2);
             }
             break;
         }
@@ -513,7 +513,6 @@ static int avi_read_header(AVFormatContext *s)
     int codec_type, stream_index, frame_period;
     unsigned int size;
     int i;
-    AVStream *st;
     AVIStream *ast      = NULL;
     int avih_width      = 0, avih_height = 0;
     int amv_file_format = 0;
@@ -599,7 +598,7 @@ static int avi_read_header(AVFormatContext *s)
 
             avio_skip(pb, size - 10 * 4);
             break;
-        case MKTAG('s', 't', 'r', 'h'):
+        case MKTAG('s', 't', 'r', 'h'): {
             /* stream header */
 
             tag1    = avio_rl32(pb);
@@ -608,18 +607,17 @@ static int avi_read_header(AVFormatContext *s)
             if (tag1 == MKTAG('p', 'a', 'd', 's')) {
                 avio_skip(pb, size - 8);
                 break;
-            } else {
-                stream_index++;
-                st = avformat_new_stream(s, NULL);
-                if (!st)
-                    return AVERROR(ENOMEM);
-
-                st->id = stream_index;
-                ast    = av_mallocz(sizeof(AVIStream));
-                if (!ast)
-                    return AVERROR(ENOMEM);
-                st->priv_data = ast;
             }
+            stream_index++;
+            AVStream *const st = avformat_new_stream(s, NULL);
+            if (!st)
+                return AVERROR(ENOMEM);
+
+            st->id = stream_index;
+            ast    = av_mallocz(sizeof(AVIStream));
+            if (!ast)
+                return AVERROR(ENOMEM);
+            st->priv_data = ast;
             if (amv_file_format)
                 tag1 = stream_index ? MKTAG('a', 'u', 'd', 's')
                                     : MKTAG('v', 'i', 'd', 's');
@@ -758,6 +756,7 @@ static int avi_read_header(AVFormatContext *s)
             ast->frame_offset = ast->cum_len;
             avio_skip(pb, size - 12 * 4);
             break;
+        }
         case MKTAG('s', 't', 'r', 'f'):
             /* stream header */
             if (!size && (codec_type == AVMEDIA_TYPE_AUDIO ||
@@ -767,12 +766,11 @@ static int avi_read_header(AVFormatContext *s)
                 avio_skip(pb, size);
             } else {
                 uint64_t cur_pos = avio_tell(pb);
-                FFStream *sti;
                 unsigned esize;
                 if (cur_pos < list_end)
                     size = FFMIN(size, list_end - cur_pos);
-                st = s->streams[stream_index];
-                sti = ffstream(st);
+                AVStream *const st = s->streams[stream_index];
+                FFStream *const sti = ffstream(st);
                 if (st->codecpar->codec_type != AVMEDIA_TYPE_UNKNOWN) {
                     avio_skip(pb, size);
                     break;
@@ -972,7 +970,7 @@ static int avi_read_header(AVFormatContext *s)
                 uint64_t cur_pos = avio_tell(pb);
                 if (cur_pos < list_end)
                     size = FFMIN(size, list_end - cur_pos);
-                st = s->streams[stream_index];
+                AVStream *const st = s->streams[stream_index];
 
                 if (size<(1<<30)) {
                     if (st->codecpar->extradata) {
@@ -1002,9 +1000,9 @@ static int avi_read_header(AVFormatContext *s)
             break;
         case MKTAG('v', 'p', 'r', 'p'):
             if (stream_index < (unsigned)s->nb_streams && size > 9 * 4) {
+                AVStream *const st = s->streams[stream_index];
                 AVRational active, active_aspect;
 
-                st = s->streams[stream_index];
                 avio_rl32(pb);
                 avio_rl32(pb);
                 avio_rl32(pb);
@@ -1497,7 +1495,7 @@ resync:
         FFStream *const sti = ffstream(st);
         AVIStream *ast = st->priv_data;
         int dv_demux = CONFIG_DV_DEMUXER && avi->dv_demux;
-        int size, err;
+        int size;
 
         if (get_subtitle_pkt(s, st, pkt))
             return 0;

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

Reply via email to