Fix bink decoder for files with 24px width.
authorBastien Bouclet <bgkweb@gmail.com>
Tue, 6 Mar 2012 19:16:20 +0000 (20:16 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 6 Mar 2012 19:20:41 +0000 (20:20 +0100)
Fixes ticket #962.

libavcodec/bink.c

index c501688..7df5871 100644 (file)
@@ -148,7 +148,7 @@ static void init_lengths(BinkContext *c, int width, int bw)
 {
     c->bundle[BINK_SRC_BLOCK_TYPES].len = av_log2((width >> 3) + 511) + 1;
 
 {
     c->bundle[BINK_SRC_BLOCK_TYPES].len = av_log2((width >> 3) + 511) + 1;
 
-    c->bundle[BINK_SRC_SUB_BLOCK_TYPES].len = av_log2((width >> 4) + 511) + 1;
+    c->bundle[BINK_SRC_SUB_BLOCK_TYPES].len = av_log2(((width + 7) >> 4) + 511) + 1;
 
     c->bundle[BINK_SRC_COLORS].len = av_log2(bw*64 + 511) + 1;
 
 
     c->bundle[BINK_SRC_COLORS].len = av_log2(bw*64 + 511) + 1;