summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2022-08-27 07:15:49 +0200
committerMarcus Meissner <marcus@jet.franken.de>2022-08-27 07:15:49 +0200
commit41533c8cd30d9716a1302b66c2a23fca6729537d (patch)
treeffe0482928c1a07c74bad52277dfde819b2d0ea3
parentc78f1ff67ed295feb18330316b079e1c45cc13b9 (diff)
downloadlibgphoto2-41533c8cd30d9716a1302b66c2a23fca6729537d.tar.gz
more debugging output in olc code
-rw-r--r--camlibs/ptp2/ptp-pack.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c
index d59519bb3..47f44a9de 100644
--- a/camlibs/ptp2/ptp-pack.c
+++ b/camlibs/ptp2/ptp-pack.c
@@ -2565,6 +2565,12 @@ static int olcsizes[0x14][13] = {
for (k=8;k<size;k++)
ptp_debug (params, " %d: %02x", k-8, curdata[k]);
}
+ if (size < 14) {
+ ce[i].type = PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN;
+ ce[i].u.info = strdup("OLC size too small");
+ ptp_debug (params, "event %d: OLC unexpected size %d", i, size);
+ break;
+ }
len = dtoh32a(curdata+8);
if ((len != size-8) && (len != size-4)) {
ce[i].type = PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN;
@@ -2573,12 +2579,7 @@ static int olcsizes[0x14][13] = {
break;
}
mask = dtoh16a(curdata+8+4);
- if (size < 14) {
- ce[i].type = PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN;
- ce[i].u.info = strdup("OLC size too small");
- ptp_debug (params, "event %d: OLC unexpected size %d", i, size);
- break;
- }
+ ptp_debug (params, "event %d: OLC mask 0x%04x length %d / data length %d", mask, len, len - 8);
curoff = 8+4+4;
if (mask & CANON_EOS_OLC_BUTTON) {
ce[i].type = PTP_CANON_EOS_CHANGES_TYPE_UNKNOWN;