diff options
author | Ben Widawsky <[email protected]> | 2017-04-05 10:31:45 -0700 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2017-04-09 09:29:57 -0700 |
commit | 6e907812f889d34d2840feda1c3e5d182a56e1ba (patch) | |
tree | 903fe9a699600d6aad204d8a1a184e82738837a1 /src/gbm | |
parent | a2eae66b8b12749c07743676863d665ac82c0e31 (diff) |
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 <[email protected]>
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/gbm')
-rw-r--r-- | src/gbm/backends/dri/gbm_dri.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 8df6a6b64d0..71590d71103 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -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 |