From ef5dfb7febd8881158e493451a27a2500ced14cb Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 18 Mar 2011 11:10:00 +0100 Subject: Initialize all camera fields with NULL to catch errors early on --- src/cameras/dummy.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/cameras/dummy.c') diff --git a/src/cameras/dummy.c b/src/cameras/dummy.c index 2ad2ec9..0d6c9d1 100644 --- a/src/cameras/dummy.c +++ b/src/cameras/dummy.c @@ -283,7 +283,7 @@ static uint32_t uca_dummy_destroy(struct uca_camera *cam) uint32_t uca_dummy_init(struct uca_camera **cam, struct uca_grabber *grabber) { - struct uca_camera *uca = (struct uca_camera *) malloc(sizeof(struct uca_camera)); + struct uca_camera *uca = uca_cam_new(); uca->destroy = &uca_dummy_destroy; uca->set_property = &uca_dummy_set_property; @@ -296,10 +296,6 @@ uint32_t uca_dummy_init(struct uca_camera **cam, struct uca_grabber *grabber) uca->state = UCA_CAM_CONFIGURABLE; uca->frame_width = 320; uca->frame_height = 240; - uca->current_frame = 0; - uca->grabber = NULL; - uca->callback = NULL; - uca->callback_user = NULL; struct dummy_cam *dummy_cam = (struct dummy_cam *) malloc(sizeof(struct dummy_cam)); dummy_cam->bitdepth = 8; -- cgit v1.2.3