summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2017-07-29 13:03:29 +0200
committerMarcus Meissner <marcus@jet.franken.de>2017-07-29 13:03:29 +0200
commit5f97b8286f8b70f25f9bb9b3032e1e44a8d1547c (patch)
treeb1286a9e188c90ace5b51df5238e514561128660
parentd5598b0e92bc411699a5aa35a60485b0087e0c9c (diff)
downloadlibgphoto2-5f97b8286f8b70f25f9bb9b3032e1e44a8d1547c.tar.gz
if we are adjusting the data pointer, also adjust len to avoid incorrect size checks (AFL)
-rw-r--r--camlibs/ptp2/ptp-pack.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c
index ef86c1c77..d3bbac745 100644
--- a/camlibs/ptp2/ptp-pack.c
+++ b/camlibs/ptp2/ptp-pack.c
@@ -705,6 +705,7 @@ ptp_unpack_OI (PTPParams *params, unsigned char* data, PTPObjectInfo *oi, unsign
if ((data[PTP_oi_filenamelen] == 0) && (data[PTP_oi_filenamelen+4] != 0)) {
params->ocs64 = 1;
data += 4;
+ len -= 4;
}
oi->ThumbFormat=dtoh16a(&data[PTP_oi_ThumbFormat]);
oi->ThumbCompressedSize=dtoh32a(&data[PTP_oi_ThumbCompressedSize]);