From 8832afef20a13722e7b7a115648dd9e4044e5bdd Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 10 Jan 2007 21:24:45 +0000 Subject: [PATCH] added NULL check in MTP objlist reader git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9876 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/ptp2/ChangeLog | 4 ++++ camlibs/ptp2/library.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/camlibs/ptp2/ChangeLog b/camlibs/ptp2/ChangeLog index 6a1ebe8bd..e62bb02e1 100644 --- a/camlibs/ptp2/ChangeLog +++ b/camlibs/ptp2/ChangeLog @@ -1,3 +1,7 @@ +2007-01-10 Marcus Meissner + + * library.c: Added NULL check in MTP objlist reader. + 2007-01-06 Marcus Meissner * library.c, ptp.c, ptp.h, ptp-private.h, usb.c: diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index f76a9ae77..d58b9969c 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -3607,6 +3607,12 @@ init_ptp_fs (Camera *camera, GPContext *context) xpl = proplist; i = -1; while (xpl) { if (lasthandle != xpl->ObjectHandle) { + if (i >= 0) { + if (!oinfos[i].Filename) { + /* i have one such file on my Creative */ + oinfos[i].Filename = strdup(""); + } + } i++; lasthandle = xpl->ObjectHandle; params->handles.Handler[i] = xpl->ObjectHandle;