Skip to content

Commit 0a1e165

Browse files
author
Grok Compression
committed
Fix compositeBoundsReduced_ not being reset for full-image decompress
When setDecompressRegion is called with region (0,0,0,0) (full image), it returns early before the block that was resetting compositeBoundsReduced_. This caused successive decompress calls (e.g. reading different bands) to incorrectly skip composite bounds reduction, producing wrong pixel values. Move the reset to the top of the function so it always executes.
1 parent 5921608 commit 0a1e165

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib/core/codestream/decompress/CodeStreamDecompress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,7 @@ std::function<void()> CodeStreamDecompress::postMultiTile(ITileProcessor* tilePr
12271227

12281228
bool CodeStreamDecompress::setDecompressRegion(RectD region)
12291229
{
1230+
compositeBoundsReduced_ = false;
12301231
auto image = headerImage_;
12311232
auto imageBounds = headerImage_->getBounds();
12321233

@@ -1258,7 +1259,6 @@ bool CodeStreamDecompress::setDecompressRegion(RectD region)
12581259
region.x1 *= scale;
12591260
region.y1 *= scale;
12601261
}
1261-
compositeBoundsReduced_ = false;
12621262
Rect16 tilesToDecompress;
12631263
auto canvasRegion = Rect32((uint32_t)region.x0 + image->x0, (uint32_t)region.y0 + image->y0,
12641264
(uint32_t)region.x1 + image->x0, (uint32_t)region.y1 + image->y0);

0 commit comments

Comments
 (0)