changeset 5699:c5c356f38cc4 libavcodec

Fix decoding of VMDs representing sprites (Last Dynasty, Woodruff). Fixes issue 101
author kostya
date Sun, 23 Sep 2007 16:11:07 +0000
parents 9a26cb6747a9
children 38d6bfd301e6
files vmdav.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vmdav.c	Sat Sep 22 10:28:22 2007 +0000
+++ b/vmdav.c	Sun Sep 23 16:11:07 2007 +0000
@@ -68,6 +68,7 @@
     unsigned char *unpack_buffer;
     int unpack_buffer_size;
 
+    int x_off, y_off;
 } VmdVideoContext;
 
 #define QUEUE_SIZE 0x1000
@@ -207,6 +208,15 @@
     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) ||