From ac914e611c6ddc6cfe188566da9f4e1046ad473d Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Sat, 19 Apr 2003 17:22:27 +0000 Subject: [PATCH] Fixed Huffman decoding issue. The loop was exiting without waiting for a terminating code. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3079 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/translators/tifftranslator/TIFFTranslator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/add-ons/translators/tifftranslator/TIFFTranslator.cpp b/src/add-ons/translators/tifftranslator/TIFFTranslator.cpp index 0dd6251ae3..94e312d84b 100755 --- a/src/add-ons/translators/tifftranslator/TIFFTranslator.cpp +++ b/src/add-ons/translators/tifftranslator/TIFFTranslator.cpp @@ -796,8 +796,9 @@ TIFFTranslator::decode_huffman(StreamBuffer *pstreambuf, TiffDetails &details, DecodeTree *ptrees[2] = {fpwhiteTree, fpblackTree}; uint8 currentcolor = 0; uint8 *pcurrentpixel = pbits; - while (pixelswrit < details.width) { - status_t value = ptrees[currentcolor]->GetValue(stream); + status_t value = 0; + while (pixelswrit < details.width || value >= 64) { + value = ptrees[currentcolor]->GetValue(stream); if (value < 0) { debugger("value < 0"); return B_ERROR;