mirror of
https://github.com/libretro/RetroArch
synced 2025-03-17 10:21:26 +00:00
Move conditional to mpng_read_plte
This commit is contained in:
parent
753a7d8569
commit
23ea613bcf
@ -139,6 +139,8 @@ static bool mpng_read_plte(struct mpng_ihdr *ihdr,
|
||||
uint32_t *buffer, unsigned entries)
|
||||
{
|
||||
unsigned i;
|
||||
if (chunk->size % 3)
|
||||
return false;
|
||||
if (!pixels || entries != 0)
|
||||
return false;
|
||||
if (chunk->size == 0 || chunk->size > 3 * 256)
|
||||
@ -234,11 +236,7 @@ bool png_decode(const void *userdata, size_t len,
|
||||
goto error;
|
||||
break;
|
||||
case MPNG_CHUNK_PLTE:
|
||||
if (chunk.size % 3)
|
||||
goto error;
|
||||
|
||||
palette_len = chunk.size / 3;
|
||||
|
||||
if (!mpng_read_plte(&ihdr, &chunk, pixels, palette, palette_len))
|
||||
goto error;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user