Optimize read_chunk_header

This commit is contained in:
twinaphex 2020-08-22 14:24:11 +02:00
parent 2e6b87d156
commit 8b5b472a2d

View File

@ -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)