summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2020-01-26 10:47:23 +0100
committerMarcus Meissner <marcus@jet.franken.de>2020-01-26 10:47:23 +0100
commit6cefcfadcc9a1c572185a033e65cd9d55d4c2bb1 (patch)
treec858a9ac9db8ffe3bd3390fc6fcacc6811e0b203
parent47e19d65d75f8b900fc663430bbe6dcacef6e2a0 (diff)
downloadlibgphoto2-6cefcfadcc9a1c572185a033e65cd9d55d4c2bb1.tar.gz
avoid endless loops on detaching devices (AFL)
-rw-r--r--camlibs/clicksmart310/clicksmart.c4
1 files changed, 3 insertions, 1 deletions
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