This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: media-ctl: 1 -> 1ULL
Author:  Hans Verkuil <[email protected]>
Date:    Wed Aug 9 20:03:21 2023 +0200

Fix coverity defect report:

*** CID 1518400:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/utils/media-ctl/media-ctl.c: 518 in media_print_pad_text()
512                             if (printed_streams_mask & (1 << stream))
513                                     continue;
514
515                             v4l2_subdev_print_format(entity, pad->index, 
stream,
516                                                      
V4L2_SUBDEV_FORMAT_ACTIVE);
517
>>>     CID 1518400:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "1 << stream" with type "int" (32 
>>> bits, signed) is evaluated using 32-bit arithmetic, and then used in a 
>>> context that expects an expression of type "uint64_t" (64 bits, unsigned).
518                             printed_streams_mask |= (1 << stream);
519                     }
520             }
521
522             v4l2_subdev_print_pad_dv(entity, pad->index, 
V4L2_SUBDEV_FORMAT_ACTIVE);
523

Here 1 << stream should be 1ULL << stream.

Signed-off-by: Hans Verkuil <[email protected]>

 utils/media-ctl/media-ctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=4a6a3725dd192759c2998311b00440b84c60df57
diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
index 1531cffaacaa..961d10c80565 100644
--- a/utils/media-ctl/media-ctl.c
+++ b/utils/media-ctl/media-ctl.c
@@ -509,13 +509,13 @@ static void media_print_pad_text(struct media_entity 
*entity,
                                stream = route->source_stream;
                        }
 
-                       if (printed_streams_mask & (1 << stream))
+                       if (printed_streams_mask & (1ULL << stream))
                                continue;
 
                        v4l2_subdev_print_format(entity, pad->index, stream,
                                                 V4L2_SUBDEV_FORMAT_ACTIVE);
 
-                       printed_streams_mask |= (1 << stream);
+                       printed_streams_mask |= (1ULL << stream);
                }
        }
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to