summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/vdpau.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2014-05-08 11:16:54 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2014-06-26 15:37:14 +0300
commit0f7958aac29ce976d6fba7d87ae40c1b8d448bbc (patch)
treeab628bf7292308f36eb383d40630450cf33adb2f /src/mesa/main/vdpau.c
parentcc5abf046050b2a25c5f4966662d3388302b3cf2 (diff)
downloadexternal_mesa3d-0f7958aac29ce976d6fba7d87ae40c1b8d448bbc.zip
external_mesa3d-0f7958aac29ce976d6fba7d87ae40c1b8d448bbc.tar.gz
external_mesa3d-0f7958aac29ce976d6fba7d87ae40c1b8d448bbc.tar.bz2
mesa/main: In register_surface() verify gl_texture_object was found
Verify _mesa_lookup_texture() returned valid pointer before using it. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/vdpau.c')
-rw-r--r--src/mesa/main/vdpau.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c
index f1b3ece..975b812 100644
--- a/src/mesa/main/vdpau.c
+++ b/src/mesa/main/vdpau.c
@@ -145,6 +145,12 @@ register_surface(struct gl_context *ctx, GLboolean isOutput,
for (i = 0; i < numTextureNames; ++i) {
struct gl_texture_object *tex;
tex = _mesa_lookup_texture(ctx, textureNames[i]);
+ if (tex == NULL) {
+ free(surf);
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "VDPAURegisterSurfaceNV(texture ID not found)");
+ return (GLintptr)NULL;
+ }
_mesa_lock_texture(ctx, tex);