diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2022-11-21 16:44:03 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2022-11-21 16:44:03 +0100 |
commit | dae0ec028d6bbf649ae3cce69ecad9986d7ace33 (patch) | |
tree | 449e0391fa1a951f2774eb2670d6428419306992 /camlibs | |
parent | b7dbae2daa1327b8f9fefa14b876a6eba54ddac8 (diff) | |
download | libgphoto2-dae0ec028d6bbf649ae3cce69ecad9986d7ace33.tar.gz |
convert malloc (overflowing mult) to calloc(x,y) that handles this internally
Diffstat (limited to 'camlibs')
-rw-r--r-- | camlibs/digigr8/library.c | 4 |
1 files 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; |