diff options
author | Juha-Pekka Heikkila <[email protected]> | 2014-05-08 11:16:54 +0300 |
---|---|---|
committer | Ville Syrjälä <[email protected]> | 2014-06-26 15:37:14 +0300 |
commit | 0f7958aac29ce976d6fba7d87ae40c1b8d448bbc (patch) | |
tree | ab628bf7292308f36eb383d40630450cf33adb2f /src | |
parent | cc5abf046050b2a25c5f4966662d3388302b3cf2 (diff) |
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 <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/vdpau.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c index f1b3eceee31..975b812cda5 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); |