Skip to content

Commit

Permalink
pnm: Don't get into infinite loops on truncated files.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 26, 2018
1 parent 06bdebe commit f963e5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IMG_pnm.c
Expand Up @@ -73,7 +73,7 @@ static int ReadNumber(SDL_RWops *src)
/* Skip leading whitespace */
do {
if ( ! SDL_RWread(src, &ch, 1, 1) ) {
return(0);
return(-1);
}
/* Eat comments as whitespace */
if ( ch == '#' ) { /* Comment is '#' to end of line */
Expand Down

0 comments on commit f963e5c

Please sign in to comment.