skin engine: handle bitmap read errors appropriately

Change-Id: Ifab0e607cb71afbe26b9e508fe1db3a8730bad4b
This commit is contained in:
Aidan MacDonald 2021-08-07 17:24:27 +01:00
parent 614b189f7a
commit a8063054f9
1 changed files with 8 additions and 2 deletions

View File

@ -1856,8 +1856,14 @@ static int load_skin_bmp(struct wps_data *wps_data, struct bitmap *bitmap, char*
return fd;
}
#ifndef __PCTOOL__
size_t buf_size = read_bmp_fd(fd, bitmap, 0,
format|FORMAT_RETURN_SIZE, NULL);
int buf_size = read_bmp_fd(fd, bitmap, 0,
format|FORMAT_RETURN_SIZE, NULL);
if(buf_size < 0)
{
close(fd);
return buf_size;
}
handle = core_alloc_ex(bitmap->data, buf_size, &buflib_ops);
if (handle <= 0)
{