]> granicus.if.org Git - libvpx/commitdiff
vp8,VP8_COMP: normalize segment_encode_breakout type
authorJames Zern <jzern@google.com>
Wed, 17 Aug 2022 00:46:24 +0000 (17:46 -0700)
committerJames Zern <jzern@google.com>
Wed, 17 Aug 2022 01:25:14 +0000 (18:25 -0700)
use unsigned int as the API value is of this type; this quiets some
integer sanitizer warnings of the form:
implicit conversion from type 'unsigned int' of value 2147483648
(32-bit, unsigned) to type 'int' changed the value to -2147483648
(32-bit, signed)

Bug: b/229626362
Change-Id: I3d1ca618bf1b3cd57a5dca65a3067f351c1473f8

test/encode_api_test.cc
vp8/encoder/onyx_int.h

index 08159148bd86be7bc6ba365944ad07dc182578b8..ecdf92834316f75af8645f62dfb6a541426cb7ff 100644 (file)
@@ -233,8 +233,8 @@ TEST(EncodeAPI, SetRoi) {
     roi.roi_map = roi_map;
     // VP8 only. This value isn't range checked.
     roi.static_threshold[1] = 1000;
-    roi.static_threshold[2] = INT_MIN;
-    roi.static_threshold[3] = INT_MAX;
+    roi.static_threshold[2] = UINT_MAX / 2 + 1;
+    roi.static_threshold[3] = UINT_MAX;
 
     for (const auto delta : { -63, -1, 0, 1, 63 }) {
       for (int i = 0; i < 8; ++i) {
index 424f51b180fc7bdac6460f23ba1e9df5882c5101..726dcc94660eeb4d65552e724fa32417f40e0d54 100644 (file)
@@ -483,7 +483,7 @@ typedef struct VP8_COMP {
 
   unsigned char *segmentation_map;
   signed char segment_feature_data[MB_LVL_MAX][MAX_MB_SEGMENTS];
-  int segment_encode_breakout[MAX_MB_SEGMENTS];
+  unsigned int segment_encode_breakout[MAX_MB_SEGMENTS];
 
   unsigned char *active_map;
   unsigned int active_map_enabled;