[Commits] SDL_image: pnm: Don't get into infinite loops on truncated files.

libsdl.org revision control commits-owner at libsdl.org
Wed Sep 26 12:19:39 PDT 2018


details:   https://hg.libsdl.org/SDL_image/rev/32a18ca05935
changeset: 587:32a18ca05935
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Wed Sep 26 15:19:34 2018 -0400
description:
pnm: Don't get into infinite loops on truncated files.

diffstat:

 IMG_pnm.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 19beb4a1bb54 -r 32a18ca05935 IMG_pnm.c
--- a/IMG_pnm.c	Wed Sep 26 15:19:17 2018 -0400
+++ b/IMG_pnm.c	Wed Sep 26 15:19:34 2018 -0400
@@ -73,7 +73,7 @@
     /* 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 */


More information about the commits mailing list