diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-03-24 10:43:10 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2011-03-24 10:43:10 +0100 |
commit | 46d38f50041e45cf878fa9a194b0f2dc7aa4dcf7 (patch) | |
tree | cc796d01bfcc1cfd727341ba016290bb2af7263e /src | |
parent | 0e684b35d4707042bba028ce47b53d0336f662e0 (diff) | |
download | libuca-46d38f50041e45cf878fa9a194b0f2dc7aa4dcf7.tar.gz libuca-46d38f50041e45cf878fa9a194b0f2dc7aa4dcf7.tar.bz2 libuca-46d38f50041e45cf878fa9a194b0f2dc7aa4dcf7.tar.xz libuca-46d38f50041e45cf878fa9a194b0f2dc7aa4dcf7.zip |
Disallow callback registration if there is no memory allocated
Diffstat (limited to 'src')
-rw-r--r-- | src/grabbers/me4.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |