summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-01-15 17:36:55 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-01-15 17:36:55 +0100
commit742a61430ae5cd323f1da8b250e7e7b5fd7d1d02 (patch)
treeed610d257e16a2c2f79b46d9bca7b62c062849f9 /modules
parent1e2b82a08c4aa5590b2f267a37cffb6f9f742dca (diff)
sdl2: check input arguments
Diffstat (limited to 'modules')
-rw-r--r--modules/sdl2/sdl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/sdl2/sdl.c b/modules/sdl2/sdl.c
index 4487e43..7199cdf 100644
--- a/modules/sdl2/sdl.c
+++ b/modules/sdl2/sdl.c
@@ -70,6 +70,9 @@ static int alloc(struct vidisp_st **stp, const struct vidisp *vd,
(void)resizeh;
(void)arg;
+ if (!stp || !vd)
+ return EINVAL;
+
st = mem_zalloc(sizeof(*st), destructor);
if (!st)
return ENOMEM;
@@ -93,6 +96,9 @@ static int display(struct vidisp_st *st, const char *title,
int pitch, ret;
unsigned i, h;
+ if (!st || !frame)
+ return EINVAL;
+
if (!vidsz_cmp(&st->size, &frame->size)) {
if (st->size.w && st->size.h) {
info("sdl: reset size: %u x %u ---> %u x %u\n",