[Commits] SDL_image: gif: report error on bogus LWZ data, instead of overf...

libsdl.org revision control commits-owner at libsdl.org
Sat Jan 27 20:28:10 PST 2018


details:   https://hg.libsdl.org/SDL_image/rev/45e750f92c84
changeset: 563:45e750f92c84
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Sat Jan 27 23:28:09 2018 -0500
description:
gif: report error on bogus LWZ data, instead of overflowing a buffer.

diffstat:

 IMG_gif.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r d0142861559c -r 45e750f92c84 IMG_gif.c
--- a/IMG_gif.c	Sat Jan 27 22:50:18 2018 -0500
+++ b/IMG_gif.c	Sat Jan 27 23:28:09 2018 -0500
@@ -497,8 +497,10 @@
             return -3;
         }
         *sp++ = table[1][code];
-        if (code == table[0][code])
-        RWSetMsg("circular table entry BIG ERROR");
+        if (code == table[0][code]) {
+            RWSetMsg("circular table entry BIG ERROR");
+            return -3;
+        }
         code = table[0][code];
     }
 


More information about the commits mailing list