all repos — mgba @ df082b46d9c9d0a31edc29d05f9c93fd5b17197e

mGBA Game Boy Advance Emulator

Utils: Make sure to seek to start of file when doing PNG check
Vicki Pfau vi@endrift.com
Mon, 01 Feb 2021 01:54:19 -0800
commit

df082b46d9c9d0a31edc29d05f9c93fd5b17197e

parent

28504b308e9b35068661dcc9eb86bbbe830b6ef7

1 files changed, 1 insertions(+), 0 deletions(-)

jump to
M src/util/png-io.csrc/util/png-io.c

@@ -210,6 +210,7 @@ }

bool isPNG(struct VFile* source) { png_byte header[PNG_HEADER_BYTES]; + source->seek(source, 0, SEEK_SET); if (source->read(source, header, PNG_HEADER_BYTES) < PNG_HEADER_BYTES) { return false; }