changeset 11679:fe1e6103b68d libavcodec

Align plane size to word-boundary. Patch by Sebastian Vater, cdgs D basty A googlemail
author cehoyos
date Wed, 05 May 2010 17:02:55 +0000
parents e1dd1ff1ab27
children f665332a6dea
files iff.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/iff.c	Mon May 03 22:08:31 2010 +0000
+++ b/iff.c	Wed May 05 17:02:55 2010 +0000
@@ -72,7 +72,7 @@
         return AVERROR_INVALIDDATA;
     }
 
-    s->planesize = avctx->width >> 3;
+    s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
     s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!s->planebuf)
         return AVERROR(ENOMEM);
@@ -99,7 +99,7 @@
 {
     GetBitContext gb;
     int i;
-    const int b = (buf_size * 8) + bps - 1;
+    const int b = buf_size * 8;
     init_get_bits(&gb, buf, buf_size * 8);
     for(i = 0; i < b; i++) {
         dst[i] |= get_bits1(&gb) << plane;
@@ -118,7 +118,7 @@
 {
     GetBitContext gb;
     int i;
-    const int b = (buf_size * 8) + bps - 1;
+    const int b = buf_size * 8;
     init_get_bits(&gb, buf, buf_size * 8);
     for(i = 0; i < b; i++) {
         dst[i] |= get_bits1(&gb) << plane;