From 46d38f50041e45cf878fa9a194b0f2dc7aa4dcf7 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 24 Mar 2011 10:43:10 +0100 Subject: Disallow callback registration if there is no memory allocated --- src/grabbers/me4.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/grabbers') diff --git a/src/grabbers/me4.c b/src/grabbers/me4.c index ba2c881..ceac483 100644 --- a/src/grabbers/me4.c +++ b/src/grabbers/me4.c @@ -196,6 +196,9 @@ static int uca_me4_callback(frameindex_t frame, struct fg_apc_data *apc) uint32_t uca_me4_register_callback(struct uca_grabber *grabber, uca_cam_grab_callback callback, void *meta_data, void *user) { + if (GET_MEM(grabber) == NULL) + return UCA_ERR_GRABBER | UCA_ERR_CALLBACK | UCA_ERR_NO_MEMORY; + if (grabber->callback == NULL) { grabber->callback = callback; -- cgit v1.2.3