Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE
GraphicsMagick.8039
GraphicsMagick-CVE-2017-11643.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File GraphicsMagick-CVE-2017-11643.patch of Package GraphicsMagick.8039
# HG changeset patch # User Bob Friesenhahn <bfriesen@GraphicsMagick.org> # Date 1500755954 18000 # Node ID d00b74315a716a62386de06732afdd2822b9f1fd # Parent 4089bde04d744cbe15842284568b2ed086dd3832 CMYK: Fixed heap overflow with multiple frames with varying widths. diff -r 4089bde04d74 -r d00b74315a71 coders/cmyk.c --- a/coders/cmyk.c Sat Jul 22 13:08:14 2017 -0500 +++ b/coders/cmyk.c Sat Jul 22 15:39:14 2017 -0500 @@ -608,16 +608,17 @@ */ static unsigned int WriteCMYKImage(const ImageInfo *image_info,Image *image) { - int + long y; register const PixelPacket *p; unsigned char - *pixels; + *pixels = (unsigned char *) NULL; unsigned int + depth, packet_size, quantum_size, scene, @@ -629,27 +630,11 @@ ExportPixelAreaInfo export_info; - if (image->depth <= 8) - quantum_size=8; - else if (image->depth <= 16) - quantum_size=16; - else - quantum_size=32; - - - /* - Allocate memory for pixels. - */ assert(image_info != (const ImageInfo *) NULL); assert(image_info->signature == MagickSignature); assert(image != (Image *) NULL); assert(image->signature == MagickSignature); - packet_size=(quantum_size*4)/8; - if (LocaleCompare(image_info->magick,"CMYKA") == 0) - packet_size=(quantum_size*5)/8; - pixels=MagickAllocateArray(unsigned char *,packet_size,image->columns); - if (pixels == (unsigned char *) NULL) - ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + if (image_info->interlace != PartitionInterlace) { /* @@ -659,16 +644,39 @@ if (status == False) ThrowWriterException(FileOpenError,UnableToOpenFile,image); } + + /* + Support depth in multiples of 8 bits. + */ + if (image->depth > 16) + depth=32; + else if (image->depth > 8) + depth=16; + else + depth=8; + + if (depth <= 8) + quantum_size=8; + else if (depth <= 16) + quantum_size=16; + else + quantum_size=32; + + packet_size=(quantum_size*4)/8; + if (LocaleCompare(image_info->magick,"CMYKA") == 0) + packet_size=(quantum_size*5)/8; + scene=0; do { /* - Convert MIFF to CMYK raster pixels. + Allocate memory for pixels. */ - (void) TransformColorspace(image,CMYKColorspace); - if (LocaleCompare(image_info->magick,"CMYKA") == 0) - if (!image->matte) - SetImageOpacity(image,OpaqueOpacity); + MagickReallocMemory(unsigned char *,pixels, + MagickArraySize(packet_size,image->columns)); + if (pixels == (unsigned char *) NULL) + ThrowWriterException(ResourceLimitError,MemoryAllocationFailed,image); + /* Initialize export options. */ @@ -677,10 +685,28 @@ export_options.endian=image->endian; else if (image_info->endian != UndefinedEndian) export_options.endian=image_info->endian; - if (image->logging) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Image depth %u bits, Endian %s",quantum_size, - EndianTypeToString(export_options.endian)); + + (void) LogMagickEvent(CoderEvent,GetMagickModule(), + "%lu: " + "Geometry %lux%lu, " + "Depth %u bits, " + "Endian %s, Packet Size %u, " + "Row bytes %" MAGICK_SIZE_T_F "u", + image->scene, + image->columns,image->rows, + quantum_size, + EndianTypeToString(export_options.endian), + packet_size, + (MAGICK_SIZE_T) MagickArraySize(packet_size,image->columns)); + + /* + Convert MIFF to CMYK raster pixels. + */ + (void) TransformColorspace(image,CMYKColorspace); + if (LocaleCompare(image_info->magick,"CMYKA") == 0) + if (!image->matte) + SetImageOpacity(image,OpaqueOpacity); + switch (image_info->interlace) { case NoInterlace:
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor