aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2021-04-20 17:27:25 +0200
committerSimon Ser <contact@emersion.fr>2021-04-20 18:10:48 +0200
commit572b5910bbac03b7c0cc20288cadf8f719a9903a (patch)
treec438378a38306c40e4c4dd30b1c0164afd130806
parent78b94a570c7b3050bb3607d82c7e770419be6411 (diff)
render: Assert that texture dimensions are > 0
-rw-r--r--render/wlr_texture.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/render/wlr_texture.c b/render/wlr_texture.c
index 0fd79908..b382e6f3 100644
--- a/render/wlr_texture.c
+++ b/render/wlr_texture.c
@@ -22,6 +22,10 @@ void wlr_texture_destroy(struct wlr_texture *texture) {
struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height,
const void *data) {
+ assert(width > 0);
+ assert(height > 0);
+ assert(stride >= width);
+ assert(data);
return renderer->impl->texture_from_pixels(renderer, fmt, stride, width,
height, data);
}