ape: Use unsigned integer maths
authorChristophe Gisquet <christophe.gisquet@gmail.com>
Tue, 28 Feb 2012 16:42:12 +0000 (17:42 +0100)
committerDiego Biurrun <diego@biurrun.de>
Thu, 10 May 2012 14:40:43 +0000 (16:40 +0200)
This involves a division that should be a shift.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
libavcodec/apedec.c

index e41f555..b07f3a0 100644 (file)
@@ -393,7 +393,7 @@ static inline int range_get_symbol(APEContext *ctx,
 }
 /** @} */ // group rangecoder
 
-static inline void update_rice(APERice *rice, int x)
+static inline void update_rice(APERice *rice, unsigned int x)
 {
     int lim = rice->k ? (1 << (rice->k + 4)) : 0;
     rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
@@ -406,7 +406,7 @@ static inline void update_rice(APERice *rice, int x)
 
 static inline int ape_decode_value(APEContext *ctx, APERice *rice)
 {
-    int x, overflow;
+    unsigned int x, overflow;
 
     if (ctx->fileversion < 3990) {
         int tmpk;