diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2007-09-23 16:11:07 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2007-09-23 16:11:07 +0000 |
commit | ac140479276b735d583659d91885e3ab0a37dabe (patch) | |
tree | 18157476b9d4ef1de5a56eaa830f700acd75a8d8 /libavcodec/vmdav.c | |
parent | c1f3c630587e7439b88f57dadaa0141d04b7b13e (diff) | |
download | ffmpeg-ac140479276b735d583659d91885e3ab0a37dabe.tar.gz |
Fix decoding of VMDs representing sprites (Last Dynasty, Woodruff).
Fixes issue 101
Originally committed as revision 10552 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vmdav.c')
-rw-r--r-- | libavcodec/vmdav.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 9507666cd4..c454be9b97 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -68,6 +68,7 @@ typedef struct VmdVideoContext { unsigned char *unpack_buffer; int unpack_buffer_size; + int x_off, y_off; } VmdVideoContext; #define QUEUE_SIZE 0x1000 @@ -207,6 +208,15 @@ static void vmd_decode(VmdVideoContext *s) frame_width = AV_RL16(&s->buf[10]) - frame_x + 1; frame_height = AV_RL16(&s->buf[12]) - frame_y + 1; + if ((frame_width == s->avctx->width && frame_height == s->avctx->height) && + (frame_x || frame_y)) { + + s->x_off = frame_x; + s->y_off = frame_y; + } + frame_x -= s->x_off; + frame_y -= s->y_off; + /* if only a certain region will be updated, copy the entire previous * frame before the decode */ if (frame_x || frame_y || (frame_width != s->avctx->width) || |