Skip to content

Commit

Permalink
lbm: Don't overflow static colormap buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 24, 2018
1 parent b48777d commit 1559b5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions IMG_lbm.c
Expand Up @@ -183,6 +183,11 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )

if ( !SDL_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";
Expand Down

0 comments on commit 1559b5c

Please sign in to comment.