mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +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:c8a87bb
AssignSegments: quiet -Warray-bounds warning3e7f34a
AssignSegments: quiet array-bounds warning Change-Id: Iec7d470be424390c66f769a19576021d0cd9a2fd
This commit is contained in:
parent
de47492e91
commit
9629f4bcda
@ -360,7 +360,12 @@ static int SegmentsAreEquivalent(const VP8SegmentInfo* const S1,
|
|||||||
|
|
||||||
static void SimplifySegments(VP8Encoder* const enc) {
|
static void SimplifySegments(VP8Encoder* const enc) {
|
||||||
int map[NUM_MB_SEGMENTS] = { 0, 1, 2, 3 };
|
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 num_final_segments = 1;
|
||||||
int s1, s2;
|
int s1, s2;
|
||||||
for (s1 = 1; s1 < num_segments; ++s1) { // find similar segments
|
for (s1 = 1; s1 < num_segments; ++s1) { // find similar segments
|
||||||
|
Loading…
Reference in New Issue
Block a user