src/render/SDL_render.c
changeset 7770 28031e0042b2
parent 7761 bddbfca922cd
child 7898 72af77fc6683
child 8535 e8ee0708ef5c
     1.1 --- a/src/render/SDL_render.c	Mon Sep 30 21:57:03 2013 -0700
     1.2 +++ b/src/render/SDL_render.c	Mon Sep 30 22:16:14 2013 -0700
     1.3 @@ -410,6 +410,11 @@
     1.4          SDL_SetError("Texture dimensions can't be 0");
     1.5          return NULL;
     1.6      }
     1.7 +    if ((renderer->info.max_texture_width && w > renderer->info.max_texture_width) ||
     1.8 +        (renderer->info.max_texture_height && h > renderer->info.max_texture_height)) {
     1.9 +        SDL_SetError("Texture dimensions are limited to %dx%d", renderer->info.max_texture_width, renderer->info.max_texture_height);
    1.10 +        return NULL;
    1.11 +    }
    1.12      texture = (SDL_Texture *) SDL_calloc(1, sizeof(*texture));
    1.13      if (!texture) {
    1.14          SDL_OutOfMemory();