aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2008-12-22 06:39:31 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2008-12-22 06:39:31 +0000
commit4386ed692200a230e129c7df1d259f4390464935 (patch)
treeb873676ea3da5da8bdaeae6e840ce151528606b1
parent4a2f51de34f71c063b8281009cf0f1305d10351a (diff)
downloadffmpeg-4386ed692200a230e129c7df1d259f4390464935.tar.gz
Calculate line size variable correctly for lower bitdepths and use it for raw data copying
Originally committed as revision 16265 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/tiff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 7e789b4759..6b2c2ada5d 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -74,7 +74,7 @@ static int tget(const uint8_t **p, int type, int le){
static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uint8_t *src, int size, int lines){
int c, line, pixels, code;
const uint8_t *ssrc = src;
- int width = s->width * (s->bpp / 8);
+ int width = s->width * s->bpp >> 3;
#ifdef CONFIG_ZLIB
uint8_t *zbuf; unsigned long outlen;
@@ -109,8 +109,8 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
}
switch(s->compr){
case TIFF_RAW:
- memcpy(dst, src, s->width * (s->bpp / 8));
- src += s->width * (s->bpp / 8);
+ memcpy(dst, src, width);
+ src += width;
break;
case TIFF_PACKBITS:
for(pixels = 0; pixels < width;){