#795: Fixed decoding of PNG comment.

This commit is contained in:
Andreas Huggel 2011-11-14 16:23:18 +00:00
parent 6b38c4c705
commit 58f2d61ecd

View File

@ -95,13 +95,13 @@ namespace Exiv2 {
#ifdef DEBUG
std::cout << "Exiv2::PngChunk::decodeTXTChunk: TXT chunk key: "
<< std::string((const char*)key.pData_) << "\n";
<< std::string((const char*)key.pData_, key.size_) << "\n";
#endif
DataBuf arr = parseTXTChunk(data, key.size_, type);
#ifdef DEBUG
std::cout << "Exiv2::PngChunk::decodeTXTChunk: TXT chunk data: "
<< std::string((const char*)arr.pData_, 32) << "\n";
<< std::string((const char*)arr.pData_, arr.size_) << "\n";
#endif
parseChunkContent(pImage, key.pData_, key.size_, arr);
@ -449,7 +449,8 @@ namespace Exiv2 {
compressedText,
compressedTextSize);
if (zlibResult == Z_OK) {
arr.alloc(uncompressedLen);
assert((uLongf)arr.size_ >= uncompressedLen);
arr.size_ = uncompressedLen;
}
else if (zlibResult == Z_BUF_ERROR) {
// the uncompressedArray needs to be larger