lagarith: Correctly compute hash_shift

All the values are unsigned.

Bug-Id: 907
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
pull/160/head
Luca Barbato 9 years ago
parent 1e7ff5ac69
commit 0b699920f3
  1. 2
      libavcodec/lagarithrac.c

@ -45,7 +45,7 @@ void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
l->range = 0x80; l->range = 0x80;
l->low = *l->bytestream >> 1; l->low = *l->bytestream >> 1;
l->hash_shift = FFMAX(l->scale - 8, 0); l->hash_shift = FFMAX(l->scale, 8) - 8;
for (i = j = 0; i < 256; i++) { for (i = j = 0; i < 256; i++) {
unsigned r = i << l->hash_shift; unsigned r = i << l->hash_shift;

Loading…
Cancel
Save