diff mbox series

[FFmpeg-devel,26/60] avcodec/g2meet: fix variable shadowing

Message ID D41CE2FHX0IG.CVBMBL1U90Q5@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,01/60] fftools/ffmpeg_opt: fix variable shadowing | expand

Commit Message

Marvin Scholz Sept. 8, 2024, 9:25 p.m. UTC
---
 libavcodec/g2meet.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Anton Khirnov Sept. 13, 2024, 10:06 a.m. UTC | #1
Quoting Marvin Scholz (2024-09-08 23:25:51)
> ---
>  libavcodec/g2meet.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)

Looks good
diff mbox series

Patch

diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 7ae987ec40..f952a06f12 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -1052,7 +1052,6 @@  static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
 {
     int width, height;
     int hdr, zsize, npal, tidx = -1, ret;
-    int i, j;
     const uint8_t *src_end = src + src_size;
     uint8_t pal[768], transp[3];
     uLongf dlen = (c->tile_width + 1) * c->tile_height;
@@ -1071,11 +1070,10 @@  static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
     hdr      = *src++;
     sub_type = hdr >> 5;
     if (sub_type == 0) {
-        int j;
         memcpy(transp, src, 3);
         src += 3;
-        for (j = 0; j < height; j++, dst += c->framebuf_stride)
-            for (i = 0; i < width; i++)
+        for (int j = 0; j < height; j++, dst += c->framebuf_stride)
+            for (int i = 0; i < width; i++)
                 memcpy(dst + i * 3, transp, 3);
         return 0;
     } else if (sub_type == 1) {
@@ -1093,7 +1091,7 @@  static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
     memcpy(pal, src, npal * 3);
     src += npal * 3;
     if (sub_type != 2) {
-        for (i = 0; i < npal; i++) {
+        for (int i = 0; i < npal; i++) {
             if (!memcmp(pal + i * 3, transp, 3)) {
                 tidx = i;
                 break;
@@ -1125,8 +1123,8 @@  static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
     bstride = FFALIGN(width, 16) >> 3;
     // blocks are coded LSB and we need normal bitreader for JPEG data
     bits = 0;
-    for (i = 0; i < (FFALIGN(height, 16) >> 4); i++) {
-        for (j = 0; j < (FFALIGN(width, 16) >> 4); j++) {
+    for (int i = 0; i < (FFALIGN(height, 16) >> 4); i++) {
+        for (int j = 0; j < (FFALIGN(width, 16) >> 4); j++) {
             if (!bits) {
                 if (src >= src_end)
                     return AVERROR_INVALIDDATA;