FS#13748 - The imageviewer plugin decodes the file infinitely when opening a empty JPEG file.

Couldn't reproduce this on most of my devices or the sims
turns out the bug depends on uninitialized memory being FF
and the file empty

Uninitialized memory fixed what I saw at least..

Change-Id: Ie267af0a20685003ee28ff42d008dd7942a7c6fc
This commit is contained in:
William Wilgus 2026-01-22 23:59:00 -05:00
parent 1c3e9c181e
commit 3c6b9bb458
2 changed files with 3 additions and 2 deletions

View file

@ -74,6 +74,7 @@ extern int TELL(void)
extern void *OPEN(char *f)
{
memset(buff, 0, sizeof(buff));
printf("Opening %s\n", f);
cur_buff_pos = length = file_pos = 0;
fd = rb->open(f,O_RDONLY);

View file

@ -4,8 +4,8 @@ static int fd;
extern int GETC(void)
{
unsigned char x;
rb->read(fd, &x, 1);
unsigned char x = 0;
rb->read(fd, &x, 1)
return x;
}