From 2e6d2fb93c7435890fd4789e4c01456f4150ff7e Mon Sep 17 00:00:00 2001 From: "hans@rhel5-devel.localdomain" Date: Fri, 29 May 2009 11:42:59 +0200 Subject: libv4l: Fix a crash in v4lcontrol_controls_changed() From: Hans de Goede Don't crash when v4lcontrol_controls_changed() gets called and we have no fake controls (null pointer dereference). Priority: normal Signed-off-by: Hans de Goede --- v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c index ec3750408..da2fbcdce 100644 --- a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c +++ b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c @@ -487,6 +487,9 @@ int v4lcontrol_controls_changed(struct v4lcontrol_data *data) { int res; + if (!data->controls) + return 0; + res = memcmp(data->shm_values, data->old_values, V4LCONTROL_COUNT * sizeof(unsigned int)); -- cgit v1.2.3