aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-04-25 12:00:18 -0600
committerBrian Paul <[email protected]>2008-04-25 15:24:07 -0600
commit9b44f5a7550d8ede2eda763770e927df4c15cc8e (patch)
tree4ab3048afaf1b432c18cc1a4a8d395f90d71dd06 /src/mesa
parent1437b41d9068017dbe981a784285d5773c1d1ead (diff)
gallium: added a null ptr check
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index a6c4351fff6..9fd9fd70ea9 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -896,6 +896,11 @@ st_TexSubimage(GLcontext * ctx,
dstRowStride = stImage->surface->pitch * stImage->surface->cpp;
}
+ if (!texImage->Data) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
+ return;
+ }
+
src = (const GLubyte *) pixels;
for (i = 0; i++ < depth;) {
@@ -907,10 +912,11 @@ st_TexSubimage(GLcontext * ctx,
texImage->ImageOffsets,
width, height, 1,
format, type, src, packing)) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "st_TexSubImage");
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage");
}
if (stImage->pt && i < depth) {
+ /* map next slice of 3D texture */
st_texture_image_unmap(stImage);
texImage->Data = st_texture_image_map(ctx->st, stImage, zoffset + i);
src += srcImageStride;