From f5be9483408511535ea1161841fb2c5231d0aebc Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Fri, 29 Jun 2012 10:52:08 -0700 Subject: [PATCH] fix jpeg malloc Image issue. Closes #160 [c-spencer] --- src/Image.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Image.cc b/src/Image.cc index 6995345..1e34f0d 100644 --- a/src/Image.cc +++ b/src/Image.cc @@ -681,7 +681,7 @@ Image::decodeJPEGIntoSurface(jpeg_decompress_struct *info) { return CAIRO_STATUS_NO_MEMORY; } - uint8_t *src = (uint8_t *) malloc(width * 3); + uint8_t *src = (uint8_t *) malloc(width * info->output_components); if (!src) { free(data); jpeg_abort_decompress(info);