[Mesa-dev] [PATCH] mesa/pbo: Handle zero height or depth when validating PBO access

Neil Roberts neil at linux.intel.com
Wed Sep 2 02:52:24 PDT 2015


Ian Romanick <idr at freedesktop.org> writes:

> It seems like it should be handled in the core, and it looks like
> _mesa_tex_sub_image is already doing that.  Note the "if (width > 0 &&
> height > 0 && depth > 0)" check.  What is the callstack that gets here
> with height or depth as zero?  That seems fishy.

This function is called by _mesa_validate_pbo_source in
texsubimage_error_check. This is called before _mesa_tex_sub_image so
the check you mentioned is too late. But yes, for Chris' code that check
should be enough because it means the driver should never see
sub-texture updates with zero sizes.

Regards,
- Neil


More information about the mesa-dev mailing list