mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-19 08:31:49 +00:00
make cppcheck happy with R_RestoreMips
132: Array 'image->pixels[4]' accessed at index -1, which is out of bounds. 133,134: Shifting by a negative value is undefined behaviour.
This commit is contained in:
parent
004e5e250f
commit
b0cc97e6f3
1 changed files with 4 additions and 4 deletions
|
@ -127,11 +127,11 @@ R_RestoreMips(image_t *image, int min_mips)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i=min_mips+1; i<NUM_MIPS; i++)
|
||||
for (i=min_mips; i<(NUM_MIPS-1); i++)
|
||||
{
|
||||
R_ImageShrink(image->pixels[i-1], image->pixels[i],
|
||||
image->width >> (i - 1), image->width >> i,
|
||||
image->height >> (i - 1), image->height >> i);
|
||||
R_ImageShrink(image->pixels[i], image->pixels[i + 1],
|
||||
image->width >> i, image->width >> (i + 1),
|
||||
image->height >> i, image->height >> (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue