[FFmpeg-cvslog] r23023 - trunk/libavcodec/iff.c

cehoyos subversion
Wed May 5 19:02:56 CEST 2010


Author: cehoyos
Date: Wed May  5 19:02:55 2010
New Revision: 23023

Log:
Align plane size to word-boundary.

Patch by Sebastian Vater, cdgs D basty A googlemail

Modified:
   trunk/libavcodec/iff.c

Modified: trunk/libavcodec/iff.c
==============================================================================
--- trunk/libavcodec/iff.c	Wed May  5 10:41:10 2010	(r23022)
+++ trunk/libavcodec/iff.c	Wed May  5 19:02:55 2010	(r23023)
@@ -72,7 +72,7 @@ static av_cold int decode_init(AVCodecCo
         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 @@ static void decodeplane8(uint8_t *dst, c
 {
     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 @@ static void decodeplane32(uint32_t *dst,
 {
     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;



More information about the ffmpeg-cvslog mailing list