From 5db498098a5fb77664ad23923e527f3ca8bc27d6 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 15 Nov 2008 06:57:33 +0000 Subject: [PATCH] texture size error fix git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3498 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/texture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/src/texture.cpp b/source/src/texture.cpp index 913b9257..e9918735 100644 --- a/source/src/texture.cpp +++ b/source/src/texture.cpp @@ -192,6 +192,12 @@ GLuint loadsurface(const char *texname, int &xs, int &ys, int &bpp, int clamp) conoutf("texture must be 8, 16, 24, or 32 bpp: %s", texname); return 0; } + if(max(s->w, s->h) > (1<<12)) + { + SDL_FreeSurface(s); + conoutf("texture size exceeded %dx%d pixels: %s", 1<<12, 1<<12, texname); + return 0; + } if(texname[0]=='<') {