This is Reviewed-by: Ian Romanick <ian.d.roman...@intel.com>
but we should probably have someone familiar with that code also review it. Christian? On 06/19/2014 05:24 AM, Juha-Pekka Heikkila wrote: > Verify _mesa_lookup_texture() returned valid pointer before using it. > > Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikk...@gmail.com> > --- > src/mesa/main/vdpau.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > 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); > > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev