Skip to content

Commit

Permalink
Replace assertions by checks in ROStreamReadBitsUX
Browse files Browse the repository at this point in the history
  • Loading branch information
y-guyon committed Oct 1, 2024
1 parent ddb5969 commit 4a1ee0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ avifBool avifROStreamSkipBits(avifROStream * stream, size_t bitCount)

avifBool avifROStreamReadBitsU8(avifROStream * stream, uint8_t * v, size_t bitCount)
{
assert(bitCount <= sizeof(*v) * 8);
AVIF_CHECK(bitCount <= sizeof(*v) * 8);
uint32_t vU32;
AVIF_CHECK(avifROStreamReadBitsU32(stream, &vU32, bitCount));
*v = (uint8_t)vU32;
Expand All @@ -171,7 +171,7 @@ avifBool avifROStreamReadBitsU8(avifROStream * stream, uint8_t * v, size_t bitCo

avifBool avifROStreamReadBitsU16(avifROStream * stream, uint16_t * v, size_t bitCount)
{
assert(bitCount <= sizeof(*v) * 8);
AVIF_CHECK(bitCount <= sizeof(*v) * 8);
uint32_t vU32;
AVIF_CHECK(avifROStreamReadBitsU32(stream, &vU32, bitCount));
*v = (uint16_t)vU32;
Expand All @@ -180,7 +180,7 @@ avifBool avifROStreamReadBitsU16(avifROStream * stream, uint16_t * v, size_t bit

avifBool avifROStreamReadBitsU32(avifROStream * stream, uint32_t * v, size_t bitCount)
{
assert(bitCount <= sizeof(*v) * 8);
AVIF_CHECK(bitCount <= sizeof(*v) * 8);
*v = 0;
while (bitCount) {
if (stream->numUsedBitsInPartialByte == 0) {
Expand Down

0 comments on commit 4a1ee0d

Please sign in to comment.