summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2017-04-01 21:47:00 +0200
committerMarcus Meissner <marcus@jet.franken.de>2017-04-01 21:47:00 +0200
commit28de76a411d24e42fbfd740e5c5b9a85bf0bbc80 (patch)
treee13e8142965c6e9efed2af3f0460b73a1198b40d
parentb826fa5d573fab8ff7029e07e02bebb898201f42 (diff)
downloadlibgphoto2-28de76a411d24e42fbfd740e5c5b9a85bf0bbc80.tar.gz
varargs are tricky. the code expects uint32, but we passed in 64bit longs
-rw-r--r--camlibs/ptp2/ptp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c
index c1ef3a752..5f0d4cc93 100644
--- a/camlibs/ptp2/ptp.c
+++ b/camlibs/ptp2/ptp.c
@@ -4096,7 +4096,8 @@ ptp_android_getpartialobject64 (PTPParams* params, uint32_t handle, uint64_t off
{
PTPContainer ptp;
- PTP_CNT_INIT(ptp, PTP_OC_ANDROID_GetPartialObject64, handle, offset & 0xFFFFFFFF, offset >> 32, maxbytes);
+ /* casts due to varargs otherwise pushing 64bit values on the stack */
+ PTP_CNT_INIT(ptp, PTP_OC_ANDROID_GetPartialObject64, handle, ((uint32_t)offset & 0xFFFFFFFF), (uint32_t)(offset >> 32), maxbytes);
return ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, object, len);
}