File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -211,8 +211,13 @@ static int _tethering_write_image(dt_imageio_module_data_t *data,
211
211
{
212
212
_tethering_format_t * d = (_tethering_format_t * )data ;
213
213
d -> buf = (float * )malloc (sizeof (float ) * 4 * d -> head .width * d -> head .height );
214
- memcpy (d -> buf , in , sizeof (float ) * 4 * d -> head .width * d -> head .height );
215
- return 0 ;
214
+ if (d -> buf )
215
+ {
216
+ memcpy (d -> buf , in , sizeof (float ) * 4 * d -> head .width * d -> head .height );
217
+ return 0 ;
218
+ }
219
+ else
220
+ return 1 ;
216
221
}
217
222
218
223
#define MARGIN DT_PIXEL_APPLY_DPI(20)
@@ -589,11 +594,14 @@ void enter(dt_view_t *self)
589
594
590
595
// register listener
591
596
lib -> listener = g_malloc0 (sizeof (dt_camctl_listener_t ));
592
- lib -> listener -> data = lib ;
593
- lib -> listener -> image_downloaded = _camera_capture_image_downloaded ;
594
- lib -> listener -> request_image_path = _camera_request_image_path ;
595
- lib -> listener -> request_image_filename = _camera_request_image_filename ;
596
- dt_camctl_register_listener (darktable .camctl , lib -> listener );
597
+ if (lib -> listener )
598
+ {
599
+ lib -> listener -> data = lib ;
600
+ lib -> listener -> image_downloaded = _camera_capture_image_downloaded ;
601
+ lib -> listener -> request_image_path = _camera_request_image_path ;
602
+ lib -> listener -> request_image_filename = _camera_request_image_filename ;
603
+ dt_camctl_register_listener (darktable .camctl , lib -> listener );
604
+ }
597
605
}
598
606
599
607
void leave (dt_view_t * self )
You can’t perform that action at this time.
0 commit comments