mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-16 17:11:03 +00:00
Handle case that ResizeSTB() failed.
This unlikely, however the compiler printed a warning that `image` may be used uninitialized.
This commit is contained in:
parent
e17d4f5dc0
commit
6566a2ae7d
1 changed files with 9 additions and 2 deletions
|
@ -376,8 +376,7 @@ R_LoadPic (char *name, byte *pic, int width, int realwidth, int height, int real
|
|||
|
||||
// resize image
|
||||
pic32 = malloc(uploadwidth * uploadheight * 4);
|
||||
if (ResizeSTB(pic, width, height,
|
||||
pic32, uploadwidth, uploadheight))
|
||||
if (ResizeSTB(pic, width, height, pic32, uploadwidth, uploadheight))
|
||||
{
|
||||
R_Convert32To8bit(pic32, pic8, uploadwidth * uploadheight, type != it_wall);
|
||||
image = R_LoadPic8(name, pic8,
|
||||
|
@ -385,6 +384,14 @@ R_LoadPic (char *name, byte *pic, int width, int realwidth, int height, int real
|
|||
uploadheight, realheight,
|
||||
uploadwidth * uploadheight, type);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Convert32To8bit(pic, pic8, data_size, type != it_wall);
|
||||
image = R_LoadPic8 (name, pic8,
|
||||
width, realwidth,
|
||||
height, realheight,
|
||||
data_size, type);
|
||||
}
|
||||
free(pic32);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue