[Mesa-dev] [PATCH v2] i965: Check return value of screen->image.loader->getBuffers (v2)

Emil Velikov emil.l.velikov at gmail.com
Tue Jun 14 14:33:34 UTC 2016


Hi Tomasz

On 13 June 2016 at 11:53, Tomasz Figa <tfiga at chromium.org> wrote:
> The images struct is an uninitialized local variable on the stack. If the
> callback returns 0, the struct might not have been updated and so should
> be considered uninitialized. Currently the code ignores the return value,
> which (depending on stack contents) might end up in reading a non-zero
> value from images.image_mask and dereferencing further fields.
>
> Another solution would be to initialize image_mask with 0, but checking
> the return value seems more sensible and it is what Gallium is doing.
>
> v2: fix typos in commit message,
>     fix indentation,
>     remove unnecessary parentheses and pointer dereference to keep line
>     length reasonable.
>
The patch is perfectly reasonable and is
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

I've added the stable tag and pushed this to master. Can you please
roll an identical fix for the i915 driver ?

Thanks
Emil


More information about the mesa-dev mailing list