From 6cefcfadcc9a1c572185a033e65cd9d55d4c2bb1 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 26 Jan 2020 10:47:23 +0100 Subject: avoid endless loops on detaching devices (AFL) --- camlibs/clicksmart310/clicksmart.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camlibs/clicksmart310/clicksmart.c b/camlibs/clicksmart310/clicksmart.c index 7ee867dcb..f09e98064 100644 --- a/camlibs/clicksmart310/clicksmart.c +++ b/camlibs/clicksmart310/clicksmart.c @@ -149,7 +149,9 @@ clicksmart_read_pic_data (CameraPrivateLibrary *priv, GPPort *port, gp_port_usb_msg_interface_write(port, 6, 0x1fff - n, 1, NULL, 0); c = 0; while (c != 1){ - CLICKSMART_READ_STATUS (port, &c); + int r; + if ((r = CLICKSMART_READ_STATUS (port, &c)) < GP_OK) + return r; } /* Get the size of the data and calculate the size to download, which * is the next multiple of 0x100. Only for the hi-res photos is the -- cgit v1.2.1