Skip to content

Commit 70fed80

Browse files
committed
Return an error in all decoding failure scenarios
1 parent 01b74c0 commit 70fed80

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/entropy/ANSRangeDecoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ int ANSRangeDecoder::decode(kanzi::byte block[], uint blkptr, uint count)
206206
memset(&block[startChunk], alphabet[0], size_t(sizeChunk));
207207
} else {
208208
if (decodeChunk(&block[startChunk], sizeChunk) == false)
209-
break;
209+
return -1;
210210
}
211211

212212
startChunk += sizeChunk;

src/entropy/HuffmanDecoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ int HuffmanDecoder::decodeV6(kanzi::byte block[], uint blkptr, uint count)
190190
return -1;
191191

192192
if (decodeChunk(&block[startChunk], sizeChunk) == false)
193-
break;
193+
return -1;
194194
}
195195
}
196196

0 commit comments

Comments
 (0)