bink: align plane width to 8 when calculating bundle sizes
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 20 Mar 2012 06:53:41 +0000 (07:53 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 20 Mar 2012 15:33:57 +0000 (16:33 +0100)
This fixes decoding of Bink files with non-multiple-of-16 width.

libavcodec/bink.c

index f8a9b5b..7a08f49 100644 (file)
@@ -146,6 +146,8 @@ enum BlockTypes {
  */
 static void init_lengths(BinkContext *c, int width, int bw)
 {
+    width = FFALIGN(width, 7);
+
     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;