shithub: dav1d

Download patch

ref: 003fa104596d3bf9ebde5874359ff5712fafb730
parent: fa1b265142e1409a986f01bd7abe115b308c1028
author: Martin Storsjö <martin@martin.st>
date: Tue Apr 16 05:34:51 EDT 2019

msac: Add a cast to indicate intended narrowing from size_t to unsigned

This fixes this compiler warning with MSVC:
../src/msac.c(148): warning C4267: '+=': conversion from 'size_t' to 'unsigned int', possible loss of data

--- a/src/msac.c
+++ b/src/msac.c
@@ -145,7 +145,7 @@
         u = v;
         v = r * (cdf[ret++] >> EC_PROB_SHIFT);
         v >>= 7 - EC_PROB_SHIFT;
-        v += EC_MIN_PROB * (n_symbols - ret);
+        v += EC_MIN_PROB * (int) (n_symbols - ret);
     } while (c < v);
 
     assert(u <= s->rng);