diff options
author | Alejandro Piñeiro <apinheiro@igalia.com> | 2019-06-07 13:08:57 +0200 |
---|---|---|
committer | Alejandro Piñeiro <apinheiro@igalia.com> | 2019-06-10 10:22:38 +0200 |
commit | d4763c7e35f88723219c658415bc658d6f113c3c (patch) | |
tree | 9779ad29ee7d77240df39e9b521329b82cb43c2f /tests/spec/arb_copy_buffer | |
parent | 59b21890772d7e88260edef662de4b5add3c056c (diff) |
arb_copy_buffer: NULL check for glMapBuffer outcome
test_copy checks if the outcome of glMapBuffer is the same that some
expected data. But we found that for drivers failing on returnign the
proper data, it is possible/likely that glMapBuffer would just return
NULL. So it would be better to check for NULL to avoid a crash, as
technically the driver is not crashing, but the test (even if the
reason glMapBuffer still needs to be investigated).
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'tests/spec/arb_copy_buffer')
-rw-r--r-- | tests/spec/arb_copy_buffer/targets.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/spec/arb_copy_buffer/targets.c b/tests/spec/arb_copy_buffer/targets.c index 7303c84f4..e3f8590bf 100644 --- a/tests/spec/arb_copy_buffer/targets.c +++ b/tests/spec/arb_copy_buffer/targets.c @@ -118,7 +118,7 @@ test_copy(GLenum from, GLenum to) glCopyBufferSubData(from, to, 0, 0, sizeof(data)); ptr = glMapBuffer(to, GL_READ_ONLY); - if (memcmp(ptr, data, sizeof(data))) { + if (ptr == NULL || memcmp(ptr, data, sizeof(data))) { fprintf(stderr, "data not copied\n"); piglit_report_result(PIGLIT_FAIL); } |