mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-17 07:58:55 +00:00
Optimize read_chunk_header
This commit is contained in:
parent
2e6b87d156
commit
8b5b472a2d
@ -955,14 +955,8 @@ static bool read_chunk_header(uint8_t *buf, uint8_t *buf_end,
|
||||
struct png_chunk *chunk)
|
||||
{
|
||||
unsigned i;
|
||||
uint8_t dword[4];
|
||||
|
||||
dword[0] = '\0';
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
dword[i] = buf[i];
|
||||
|
||||
chunk->size = dword_be(dword);
|
||||
chunk->size = dword_be(buf);
|
||||
|
||||
/* Check whether chunk will overflow the data buffer */
|
||||
if (buf + 8 + chunk->size > buf_end)
|
||||
|
Loading…
x
Reference in New Issue
Block a user