From: havoc Date: Mon, 7 Dec 2009 20:21:30 +0000 (+0000) Subject: R_UpdateTexture no longer calls R_RealGetTexture, and now causes a X-Git-Tag: xonotic-v0.1.0preview~1090 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=baeccc88e71e8dc74091a6cef842088430871f8b;p=xonotic%2Fdarkplaces.git R_UpdateTexture no longer calls R_RealGetTexture, and now causes a Host_Error if the texture has not been precached already, this should fix a crash with dpv video playback git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9556 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_textures.c b/gl_textures.c index 4b4f6cc3..4e86d252 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -1154,17 +1154,14 @@ int R_TextureHeight(rtexture_t *rt) void R_UpdateTexture(rtexture_t *rt, const unsigned char *data, int x, int y, int width, int height) { - gltexture_t *glt; - if (rt == NULL) - Host_Error("R_UpdateTexture: no texture supplied"); + gltexture_t *glt = (gltexture_t *)rt; if (data == NULL) Host_Error("R_UpdateTexture: no data supplied"); - - // we need it to be uploaded before we can update a part of it - R_RealGetTexture(rt); - + if (glt == NULL) + Host_Error("R_UpdateTexture: no texture supplied"); + if (!glt->texnum) + Host_Error("R_UpdateTexture: texture has not been uploaded yet"); // update part of the texture - glt = (gltexture_t *)rt; R_Upload(glt, data, x, y, 0, width, height, 1); }