diff --git a/pipi/codec/oric.c b/pipi/codec/oric.c index bb9fe76..6ae5f25 100644 --- a/pipi/codec/oric.c +++ b/pipi/codec/oric.c @@ -173,10 +173,10 @@ static int read_screen(char const *name, uint8_t *screen) if(ch != 0x24) goto syntax_error; - /* Skip the header */ + /* Skip the header, ignoring the last byte’s value */ if(fgetc(fp) != 0x00 || fgetc(fp) != 0xff || fgetc(fp) != 0x80 || fgetc(fp) != 0x00 || fgetc(fp) != 0xbf || fgetc(fp) != 0x3f - || fgetc(fp) != 0xa0 || fgetc(fp) != 0x00 || fgetc(fp) != 0x00) + || fgetc(fp) != 0xa0 || fgetc(fp) != 0x00 || fgetc(fp) == EOF) goto syntax_error; /* Skip the file name, including trailing nul char */