commit 51bfc48082abcca4615a95aad2b1fc79d75e6d96
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Sun Apr 12 21:52:22 2026 +0200
avoid decrementing zero value
diff --git a/libheif/bitstream.cc b/libheif/bitstream.cc
index 4393c059..cf760e2f 100644
--- a/libheif/bitstream.cc
+++ b/libheif/bitstream.cc
@@ -652,7 +652,8 @@ int BitReader::peek_bits(int n)
void BitReader::skip_bytes(uint32_t nBytes)
{
// TODO: this is slow
- while (nBytes--) {
+ while (nBytes) {
+ nBytes--;
skip_bits(8);
}
}