src/video/SDL_bmp.c
changeset 12612 07c39cbbeacf
parent 12503 806492103856
child 12644 7c643f1c1887
equal deleted inserted replaced
12610:587922004ea0 12612:07c39cbbeacf
   311     palette = (surface->format)->palette;
   311     palette = (surface->format)->palette;
   312     if (palette) {
   312     if (palette) {
   313         SDL_assert(biBitCount <= 8);
   313         SDL_assert(biBitCount <= 8);
   314         if (biClrUsed == 0) {
   314         if (biClrUsed == 0) {
   315             biClrUsed = 1 << biBitCount;
   315             biClrUsed = 1 << biBitCount;
       
   316 		} else if (biClrUsed > (1 << biBitCount)) {
       
   317 			SDL_SetError("BMP file has an invalid number of colors");
       
   318 			was_error = SDL_TRUE;
       
   319 			goto done;
   316         }
   320         }
   317         if ((int) biClrUsed > palette->ncolors) {
   321         if ((int) biClrUsed > palette->ncolors) {
   318             SDL_Color *colors;
   322             SDL_Color *colors;
   319             int ncolors = biClrUsed;
   323             int ncolors = biClrUsed;
   320             colors =
   324             colors =