summaryrefslogtreecommitdiff
path: root/camlibs/jl2005c
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2010-12-26 17:06:41 +0000
committerMarcus Meissner <marcus@jet.franken.de>2010-12-26 17:06:41 +0000
commit921f376e3a8cc105753b062d8d2848377ff9c2ce (patch)
treedc5e56adcf9746677adf6cac7b2b6074926e6278 /camlibs/jl2005c
parent939fc47fb80f0d33a6fae4e984824825dfdf23fc (diff)
downloadlibgphoto2-921f376e3a8cc105753b062d8d2848377ff9c2ce.tar.gz
allocate enoug memory for out ... (500kb was not sufficient)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13450 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/jl2005c')
-rw-r--r--camlibs/jl2005c/jl2005bcd_decompress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/camlibs/jl2005c/jl2005bcd_decompress.c b/camlibs/jl2005c/jl2005bcd_decompress.c
index 42916ba86..423bdacfc 100644
--- a/camlibs/jl2005c/jl2005bcd_decompress.c
+++ b/camlibs/jl2005c/jl2005bcd_decompress.c
@@ -117,7 +117,7 @@ jl2005bcd_decompress (unsigned char *output, unsigned char *input,
GP_DEBUG("No thumbnail is present!\n");
return GP_ERROR_NOT_SUPPORTED;
} else {
- out = malloc(MAXBUFSIZE);
+ out = malloc(thumbnail_width * thumbnail_height * 3);
thumb = input + 16;
for (i = 0; i < thumbnail_width * thumbnail_height;
i++) {
@@ -201,7 +201,6 @@ jl2005bcd_decompress (unsigned char *output, unsigned char *input,
samp_image[1] = red_row_pointer;
samp_image[2] = blue_row_pointer;
- out = malloc(MAXBUFSIZE);
jpeg_stripe = malloc(MAXBUFSIZE);
memcpy(jpeg_stripe, jpeg_header, JPEG_HEADER_SIZE);
jpeg_stripe[JPEG_HEIGHT_OFFSET ] = height >> 8;
@@ -215,6 +214,7 @@ jl2005bcd_decompress (unsigned char *output, unsigned char *input,
jpeg_data_idx = 0;
+ out = malloc(width * height * 3);
memset(out, 0, width * height * 3);
dinfo.err = jpeg_std_error (&jderr);