summaryrefslogtreecommitdiff
path: root/camlibs/ricoh
diff options
context:
space:
mode:
authorIngvar Stepanyan <me@rreverser.com>2022-09-26 08:07:17 +0100
committerGitHub <noreply@github.com>2022-09-26 09:07:17 +0200
commite465cb4ac861ad9f0b9886a18576d6e0d43c950f (patch)
tree6ab2907ffc6ff635a5d647669a7d7285c80f51a8 /camlibs/ricoh
parent0a87bb875fc4fbbce118c2d986be2b0d63f9f7cc (diff)
downloadlibgphoto2-e465cb4ac861ad9f0b9886a18576d6e0d43c950f.tar.gz
Zero-fill CameraFileInfo (#838)
I've noticed in my tests that for many files the CameraFileInfo incorrectly had `info.audio` marked as available (with various flags). Thanks to valgrind I found that it's because `CameraFileInfo` is zero-filled in some places, but not others, so the `audio.fields` (as well as entire `audio`) was filled with uninitialized data. I tried to find all usages of `info.file.fields = ...` and `info.preview.fields = ...` and zero-initialize them in the same way as it already is in other places.
Diffstat (limited to 'camlibs/ricoh')
-rw-r--r--camlibs/ricoh/g3.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/camlibs/ricoh/g3.c b/camlibs/ricoh/g3.c
index bd1d76a52..77681e0b6 100644
--- a/camlibs/ricoh/g3.c
+++ b/camlibs/ricoh/g3.c
@@ -819,6 +819,7 @@ file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
ret = gp_filesystem_append (fs, folder, xfn, context);
if (ret < GP_OK) goto out;
+ memset (&info, 0, sizeof (info));
/* we also get parts of fs info for free, so just set it */
info.file.fields =
GP_FILE_INFO_SIZE |