From dae0ec028d6bbf649ae3cce69ecad9986d7ace33 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 21 Nov 2022 16:44:03 +0100 Subject: convert malloc (overflowing mult) to calloc(x,y) that handles this internally --- camlibs/digigr8/library.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camlibs/digigr8/library.c b/camlibs/digigr8/library.c index f27caa768..1bbcbca39 100644 --- a/camlibs/digigr8/library.c +++ b/camlibs/digigr8/library.c @@ -291,7 +291,7 @@ get_file_func(CameraFilesystem *fs, const char *folder, const char *filename, ptr = ppm + size; size = size + (w * h * 3); GP_DEBUG ("size = %i\n", size); - p_data = malloc(w * h); + p_data = calloc(w , h); if (!p_data) { status = GP_ERROR_NO_MEMORY; free (ppm); @@ -370,7 +370,7 @@ camera_capture_preview(Camera *camera, CameraFile *file, GPContext *context) GP_DEBUG("Error in reading data\n"); return GP_ERROR; } - frame_data = malloc(w * h); + frame_data = calloc(w , h); if (!frame_data) { free(raw_data); return GP_ERROR_NO_MEMORY; -- cgit v1.2.1