Sophie

Sophie

distrib > Mageia > 8 > x86_64 > by-pkgid > a48407b9ae23d07a9f26b820f1a114a4 > files > 3

SDL_image-1.2.12-14.mga8.src.rpm

Description: lbm: Don't overflow static colormap buffer.
Origin: upstream, https://hg.libsdl.org/SDL_image/rev/bfa08dc02b3c

--- a/IMG_lbm.c
+++ b/IMG_lbm.c
@@ -187,6 +187,11 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
 
 		if ( !memcmp( id, "CMAP", 4 ) ) /* palette ( Color Map ) */
 		{
+			if (size > sizeof (colormap)) {
+				error="colormap size is too large";
+				goto done;
+			}
+
 			if ( !SDL_RWread( src, &colormap, size, 1 ) )
 			{
 				error="error reading CMAP chunk";