# HG changeset patch
# User Ryan C. Gordon <icculus@icculus.org>
# Date 1517113689 18000
# Node ID 45e750f92c843dccea0820d86726e9cf1d524392
# Parent  d0142861559ccd4fde994fbd33c34fbdee25f84c
gif: report error on bogus LWZ data, instead of overflowing a buffer.

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];
     }
 
