projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc5abf0
)
mesa/main: In register_surface() verify gl_texture_object was found
author
Juha-Pekka Heikkila
<juhapekka.heikkila@gmail.com>
Thu, 8 May 2014 08:16:54 +0000
(11:16 +0300)
committer
Ville Syrjälä
<ville.syrjala@linux.intel.com>
Thu, 26 Jun 2014 12:37:14 +0000
(15:37 +0300)
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>
src/mesa/main/vdpau.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/vdpau.c
b/src/mesa/main/vdpau.c
index f1b3eceee3166ce40045df530822b861873d92eb..975b812cda5f95ccb2766a966af4ec308900b0e8 100644
(file)
--- 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);