src/render/SDL_render.c
changeset 8650 058c88ce501c
parent 8649 4ee50f124da2
child 8654 275c4c82803b
     1.1 --- a/src/render/SDL_render.c	Thu Mar 20 10:41:47 2014 -0400
     1.2 +++ b/src/render/SDL_render.c	Thu Mar 20 11:14:44 2014 -0400
     1.3 @@ -404,6 +404,10 @@
     1.4      if (!format) {
     1.5          format = renderer->info.texture_formats[0];
     1.6      }
     1.7 +    if (SDL_BYTESPERPIXEL(format) == 0) {
     1.8 +        SDL_SetError("Invalid texture format");
     1.9 +        return NULL;
    1.10 +    }
    1.11      if (SDL_ISPIXELFORMAT_INDEXED(format)) {
    1.12          SDL_SetError("Palettized textures are not supported");
    1.13          return NULL;