Fix CVE 2006-4484. Should be backported.
[vlc.git] / extras / contrib / src / Patches / SDL_image-CVE-2006-4484.patch
1 Common subdirectories: sdl-image1.2-1.2.5/debian and sdl-image1.2-1.2.5-fixed/debian
2 diff -up sdl-image1.2-1.2.5/IMG_gif.c sdl-image1.2-1.2.5-fixed/IMG_gif.c
3 --- sdl-image1.2-1.2.5/IMG_gif.c        2008-01-30 19:49:29.000000000 -0500
4 +++ sdl-image1.2-1.2.5-fixed/IMG_gif.c  2008-01-30 19:52:56.000000000 -0500
5 @@ -418,6 +418,10 @@ LWZReadByte(SDL_RWops *src, int flag, in
6      static int stack[(1 << (MAX_LWZ_BITS)) * 2], *sp;
7      register int i;
8  
9 +    /* Fixed buffer overflow found by Michael Skladnikiewicz */
10 +    if (input_code_size > MAX_LWZ_BITS)
11 +        return -1;
12 +
13      if (flag) {
14         set_code_size = input_code_size;
15         code_size = set_code_size + 1;