# HG changeset patch # User cehoyos # Date 1273078975 0 # Node ID fe1e6103b68d6993fbb4ae462cc6d4350d975a40 # Parent e1dd1ff1ab2773ce0fbb0b58ac7958d269006fc3 Align plane size to word-boundary. Patch by Sebastian Vater, cdgs D basty A googlemail diff -r e1dd1ff1ab27 -r fe1e6103b68d iff.c --- 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;