mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 18:35:41 +01:00 
			
		
		
		
	SimplifySegments: quiet -Warray-bounds warning
the number of segments are previously validated, but an explicit check is needed to avoid a warning under gcc-4.9 this is similar to the changes made in:c8a87bbAssignSegments: quiet -Warray-bounds warning3e7f34aAssignSegments: quiet array-bounds warning Change-Id: Iec7d470be424390c66f769a19576021d0cd9a2fd
This commit is contained in:
		| @@ -360,7 +360,12 @@ static int SegmentsAreEquivalent(const VP8SegmentInfo* const S1, | ||||
|  | ||||
| static void SimplifySegments(VP8Encoder* const enc) { | ||||
|   int map[NUM_MB_SEGMENTS] = { 0, 1, 2, 3 }; | ||||
|   const int num_segments = enc->segment_hdr_.num_segments_; | ||||
|   // 'num_segments_' is previously validated and <= NUM_MB_SEGMENTS, but an | ||||
|   // explicit check is needed to avoid a spurious warning about 'i' exceeding | ||||
|   // array bounds of 'dqm_' with some compilers (noticed with gcc-4.9). | ||||
|   const int num_segments = (enc->segment_hdr_.num_segments_ < NUM_MB_SEGMENTS) | ||||
|                                ? enc->segment_hdr_.num_segments_ | ||||
|                                : NUM_MB_SEGMENTS; | ||||
|   int num_final_segments = 1; | ||||
|   int s1, s2; | ||||
|   for (s1 = 1; s1 < num_segments; ++s1) {    // find similar segments | ||||
|   | ||||
		Reference in New Issue
	
	Block a user