sdl2-config.cmake.in
author Sam Lantinga <slouken@libsdl.org>
Mon, 18 Feb 2019 07:50:33 -0800
changeset 12612 07c39cbbeacf
parent 10474 e723c663ba58
permissions -rw-r--r--
Fixed bug 4500 - Heap-Buffer Overflow in Map1toN pertaining to SDL_pixels.c

Petr Pisar

The reproducer has these data in BITMAPINFOHEADER:

biSize = 40
biBitCount = 8
biClrUsed = 131075

SDL_LoadBMP_RW() function passes biBitCount as a color depth to SDL_CreateRGBSurface(), thus 256-color pallete is allocated. But then biClrUsed colors are read from a file and stored into the palette. SDL_LoadBMP_RW should report an error if biClrUsed is greater than 2^biBitCount.
slouken@9785
     1
# sdl2 cmake project-config input for ./configure scripts
slouken@9785
     2
slouken@9785
     3
set(prefix "@prefix@") 
slouken@9785
     4
set(exec_prefix "@exec_prefix@")
icculus@9978
     5
set(libdir "@libdir@")
slouken@9785
     6
set(SDL2_PREFIX "@prefix@")
slouken@9785
     7
set(SDL2_EXEC_PREFIX "@prefix@")
slouken@9785
     8
set(SDL2_LIBDIR "@libdir@")
slouken@9785
     9
set(SDL2_INCLUDE_DIRS "@includedir@/SDL2")
slouken@9785
    10
set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@")
slouken@10474
    11
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)