Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1
libpgf
libpgf-r147.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libpgf-r147.patch of Package libpgf
diff -up libpgf/include/PGFimage.h.r147 libpgf/include/PGFimage.h --- libpgf/include/PGFimage.h.r147 2015-08-10 10:24:28.319204436 -0500 +++ libpgf/include/PGFimage.h 2015-08-10 10:44:12.588655556 -0500 @@ -538,7 +538,7 @@ private: ProgressMode m_progressMode; ///< progress mode used in Read and Write; PM_Relative is default mode void ComputeLevels(); - void CompleteHeader(); + bool CompleteHeader(); void RgbToYuv(int pitch, UINT8* rgbBuff, BYTE bpp, int channelMap[], CallbackPtr cb, void *data) THROW_; void Downsample(int nChannel); UINT32 UpdatePostHeaderSize() THROW_; diff -up libpgf/src/Decoder.cpp.r147 libpgf/src/Decoder.cpp --- libpgf/src/Decoder.cpp.r147 2015-08-10 10:24:28.637208326 -0500 +++ libpgf/src/Decoder.cpp 2015-08-10 10:45:04.349979345 -0500 @@ -158,7 +158,7 @@ CDecoder::CDecoder(CPGFStream* stream, P if (size > 0) { // read post-header if (header.mode == ImageModeIndexedColor) { - ASSERT((size_t)size >= ColorTableSize); + if (size < ColorTableSize) ReturnWithError(FormatCannotRead); // read color table count = expected = ColorTableSize; m_stream->Read(&count, postHeader.clut); diff -up libpgf/src/PGFimage.cpp.r147 libpgf/src/PGFimage.cpp --- libpgf/src/PGFimage.cpp.r147 2014-03-21 07:09:10.000000000 -0500 +++ libpgf/src/PGFimage.cpp 2015-08-10 10:45:33.371423512 -0500 @@ -145,7 +145,7 @@ void CPGFImage::Open(CPGFStream *stream) m_height[0] = m_header.height; // complete header - CompleteHeader(); + if (!CompleteHeader()) ReturnWithError(FormatCannotRead); // interpret quant parameter if (m_header.quality > DownsampleThreshold && @@ -205,7 +205,7 @@ void CPGFImage::Open(CPGFStream *stream) } //////////////////////////////////////////////////////////// -void CPGFImage::CompleteHeader() { +bool CPGFImage::CompleteHeader() { if (m_header.mode == ImageModeUnknown) { // undefined mode switch(m_header.bpp) { @@ -261,20 +261,20 @@ void CPGFImage::CompleteHeader() { // change mode m_header.mode = ImageModeRGBA; } - ASSERT(m_header.mode != ImageModeBitmap || m_header.bpp == 1); - ASSERT(m_header.mode != ImageModeIndexedColor || m_header.bpp == 8); - ASSERT(m_header.mode != ImageModeGrayScale || m_header.bpp == 8); - ASSERT(m_header.mode != ImageModeGray16 || m_header.bpp == 16); - ASSERT(m_header.mode != ImageModeGray32 || m_header.bpp == 32); - ASSERT(m_header.mode != ImageModeRGBColor || m_header.bpp == 24); - ASSERT(m_header.mode != ImageModeRGBA || m_header.bpp == 32); - ASSERT(m_header.mode != ImageModeRGB12 || m_header.bpp == 12); - ASSERT(m_header.mode != ImageModeRGB16 || m_header.bpp == 16); - ASSERT(m_header.mode != ImageModeRGB48 || m_header.bpp == 48); - ASSERT(m_header.mode != ImageModeLabColor || m_header.bpp == 24); - ASSERT(m_header.mode != ImageModeLab48 || m_header.bpp == 48); - ASSERT(m_header.mode != ImageModeCMYKColor || m_header.bpp == 32); - ASSERT(m_header.mode != ImageModeCMYK64 || m_header.bpp == 64); + if (m_header.mode == ImageModeBitmap && m_header.bpp != 1) return false; + if (m_header.mode == ImageModeIndexedColor && m_header.bpp != 8) return false; + if (m_header.mode == ImageModeGrayScale && m_header.bpp != 8) return false; + if (m_header.mode == ImageModeGray16 && m_header.bpp != 16) return false; + if (m_header.mode == ImageModeGray32 && m_header.bpp != 32) return false; + if (m_header.mode == ImageModeRGBColor && m_header.bpp != 24) return false; + if (m_header.mode == ImageModeRGBA && m_header.bpp != 32) return false; + if (m_header.mode == ImageModeRGB12 && m_header.bpp != 12) return false; + if (m_header.mode == ImageModeRGB16 && m_header.bpp != 16) return false; + if (m_header.mode == ImageModeRGB48 && m_header.bpp != 48) return false; + if (m_header.mode == ImageModeLabColor && m_header.bpp != 24) return false; + if (m_header.mode == ImageModeLab48 && m_header.bpp != 48) return false; + if (m_header.mode == ImageModeCMYKColor && m_header.bpp != 32) return false; + if (m_header.mode == ImageModeCMYK64 && m_header.bpp != 64) return false; // set number of channels if (!m_header.channels) { @@ -300,8 +300,7 @@ void CPGFImage::CompleteHeader() { m_header.channels = 4; break; default: - ASSERT(false); - m_header.channels = 3; + return false; } } @@ -311,6 +310,8 @@ void CPGFImage::CompleteHeader() { if (!m_header.usedBitsPerChannel || m_header.usedBitsPerChannel > bpc) { m_header.usedBitsPerChannel = bpc; } + + return true; } //////////////////////////////////////////////////////////////////////
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