From 691514583444d71c25ddd7b380dc1048c808039a Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 24 May 2020 10:20:11 +0200 Subject: if the partialobject loop does not make progress (xlen = 0), leave it https://github.com/gphoto/libgphoto2/issues/487 --- camlibs/ptp2/library.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 8ff3d0952..b0007c596 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -7917,6 +7917,10 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, free (ximage); ximage = NULL; offset += xlen; + if (!xlen) { + GP_LOG_E ("getpartialobject loop: offset=%d, size is %d, xlen returned is 0?", offset, size); + break; + } } goto done; } -- cgit v1.2.1