changeset 11244:eb773ca000d9 libavcodec

Correct bundle lengths calculation for small Bink files. This fixes issue 1764.
author kostya
date Mon, 22 Feb 2010 12:20:49 +0000
parents e71b0be9ac79
children 1e9ff636c3db
files bink.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bink.c	Mon Feb 22 12:20:31 2010 +0000
+++ b/bink.c	Mon Feb 22 12:20:49 2010 +0000
@@ -698,8 +698,9 @@
         const int stride = c->pic.linesize[plane];
         int bw = plane ? (avctx->width  + 15) >> 4 : (avctx->width  + 7) >> 3;
         int bh = plane ? (avctx->height + 15) >> 4 : (avctx->height + 7) >> 3;
+        int width = avctx->width >> !!plane;
 
-        init_lengths(c, avctx->width >> !!plane, bw);
+        init_lengths(c, FFMAX(width, 8), bw);
         for (i = 0; i < BINK_NB_SRC; i++)
             read_bundle(&gb, c, i);