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:
Denis Pauk 2020-12-23 12:36:45 +02:00
parent 004e5e250f
commit b0cc97e6f3

View file

@ -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));
}
}