shithub: dav1d

Download patch

ref: ca33a9b78036e1b456fca111a70a635bea401c95
parent: a79cebf2e69264adc07738df0052ccf9c6255492
author: Rupert Swarbrick <[email protected]>
date: Wed Nov 14 12:15:04 EST 2018

Fix operator order in obu.c

This code originally looked like "assert (init_bit_pos % 8 == 0)" and
I changed it to use "& 7" to match the prevaling style. Unfortunately,
"&" binds more weakly than "==". Oops!

--- a/src/obu.c
+++ b/src/obu.c
@@ -1070,7 +1070,7 @@
     // We must have read a whole number of bytes at this point (1 byte
     // for the header and whole bytes at a time when reading the
     // leb128 length field).
-    assert(init_bit_pos & 7 == 0);
+    assert((init_bit_pos & 7) == 0);
 
     // We also know that we haven't tried to read more than in->sz
     // bytes yet (otherwise the error flag would have been set by the
@@ -1148,7 +1148,7 @@
         // just aligned it) and less than 8*pkt_bytelen because
         // otherwise the overrun check would have fired.
         const unsigned bit_pos = dav1d_get_bits_pos(&gb);
-        assert(bit_pos & 7 == 0);
+        assert((bit_pos & 7) == 0);
         assert(pkt_bytelen > (bit_pos >> 3));
         dav1d_ref_inc(in->ref);
         c->tile[c->n_tile_data].data.ref = in->ref;