mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 23:20:08 +01:00
progs/util: Exit RawImageGetData early if malloc fails.
Prevents a null pointer deference later on.
This commit is contained in:
parent
c88b18a4df
commit
e26135a744
1 changed files with 1 additions and 0 deletions
|
|
@ -230,6 +230,7 @@ static void RawImageGetData(rawImageRec *raw, TK_RGBImageRec *final)
|
|||
final->data = (unsigned char *)malloc((raw->sizeX+1)*(raw->sizeY+1)*4);
|
||||
if (final->data == NULL) {
|
||||
fprintf(stderr, "Out of memory!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ptr = final->data;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue