diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2006-09-05 07:29:26 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2006-09-05 07:29:26 +0000 |
commit | c0d6fc1f739135fe72059a0d5ea9b33e8840fe7e (patch) | |
tree | c283fb1093ab5954c7887f7584332a5f67e5c0c3 /libavcodec/vmnc.c | |
parent | eb57c88973cacd0e451fea3a6bbaff66e6dacedd (diff) | |
download | ffmpeg-c0d6fc1f739135fe72059a0d5ea9b33e8840fe7e.tar.gz |
Handle raw blocks correctly (both updating pointer and storing to memory)
Originally committed as revision 6172 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vmnc.c')
-rw-r--r-- | libavcodec/vmnc.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index 8771891706..927cdcaf87 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -105,7 +105,17 @@ static always_inline void paint_raw(uint8_t *dst, int w, int h, uint8_t* src, in 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 @@ static int decode_hextile(VmncContext *c, uint8_t* dst, uint8_t* src, int w, int 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; |