Mercurial > libavcodec.hg
changeset 3678:93a961e40d65 libavcodec
Handle raw blocks correctly (both updating pointer and storing to memory)
author | kostya |
---|---|
date | Tue, 05 Sep 2006 07:29:26 +0000 |
parents | 18b13b923616 |
children | 2702eec8c8b9 |
files | vmnc.c |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/vmnc.c Tue Sep 05 04:37:14 2006 +0000 +++ b/vmnc.c Tue Sep 05 07:29:26 2006 +0000 @@ -105,7 +105,17 @@ for(i = 0; i < w; i++) { p = vmnc_get_pixel(src, bpp, be); src += bpp; - memcpy(dst + i*bpp, &p, bpp); + switch(bpp){ + case 1: + dst[i] = p; + break; + case 2: + ((uint16_t*)dst)[i] = p; + break; + case 4: + ((uint32_t*)dst)[i] = p; + break; + } } dst += stride; } @@ -129,6 +139,7 @@ flags = *src++; if(flags & HT_RAW) { paint_raw(dst2, bw, bh, src, bpp, c->bigendian, stride); + src += bw * bh * bpp; } else { if(flags & HT_BKG) { bg = vmnc_get_pixel(src, bpp, c->bigendian); src += bpp;