From 742a61430ae5cd323f1da8b250e7e7b5fd7d1d02 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 15 Jan 2017 17:36:55 +0100 Subject: sdl2: check input arguments --- modules/sdl2/sdl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules') 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", -- cgit v1.2.3