From 4c830d4862461b5d0b086289b251b850884cbd57 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 27 Jan 2018 23:28:09 -0500 Subject: [PATCH] gif: report error on bogus LWZ data, instead of overflowing a buffer. --- IMG_gif.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IMG_gif.c b/IMG_gif.c index ac3d7abb..c731cf29 100755 --- a/IMG_gif.c +++ b/IMG_gif.c @@ -497,8 +497,10 @@ LWZReadByte(SDL_RWops *src, int flag, int input_code_size) 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]; }