[Mesa-dev] [PATCH 2/2] glx/dri3: handle NULL pointers in loader-to-DRI3 drawable conversion

Emil Velikov emil.l.velikov at gmail.com
Mon Jan 30 13:35:48 UTC 2017


On 27 January 2017 at 10:59, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> With the previous patch, we can now get NULL loaderPrivates, e.g. when
> a DRIdrawable is flushed whose corresponding GLXDRIdrawable was destroyed.
> This resulted in a crash, since the loader vs. DRI3 drawable structures
> have a non-zero offset.
>
Just a couple of questions, feel free to disagree ;-)

We have multiple cases where the NULL ptr returned by
loader_drawable_to_dri3_drawable() is unchecked and dereferenced.
Did you look if any of those can be hit  - worth adding an assert ?

Can you flip the patch order such that we don't cause a crash (not
that memory corruption is too much better).

Thanks
Emil


More information about the mesa-dev mailing list