mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
gbm: Assert modifiers and count are copacetic
The API/entry point in mesa already checks the correct behavior, however, it's possible to be handled by another implementation and those implementations should not be able to abuse a weird combination of count and pointer. This fixes CID 1403193 Cc: Mark Janes <mark.a.janes@intel.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
a2eae66b8b
commit
6e907812f8
1 changed files with 3 additions and 0 deletions
|
|
@ -1266,6 +1266,9 @@ gbm_dri_surface_create(struct gbm_device *gbm,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (count)
|
||||
assert(modifiers);
|
||||
|
||||
/* It's acceptable to create an image with INVALID modifier in the list,
|
||||
* but it cannot be on the only modifier (since it will certainly fail
|
||||
* later). While we could easily catch this after modifier creation, doing
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue