changeset 1604:21190cfac0e1 libavcodec

100l: sometime palette was not copied to output frame
author rtognimp
date Wed, 05 Nov 2003 23:27:23 +0000
parents 3a633a3feef6
children 2fb583cb0013
files msrle.c
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/msrle.c	Tue Nov 04 19:35:43 2003 +0000
+++ b/msrle.c	Wed Nov 05 23:27:23 2003 +0000
@@ -67,6 +67,13 @@
     int row_ptr = (s->avctx->height - 1) * row_dec;
     int frame_size = row_dec * s->avctx->height;
 
+    /* make the palette available */
+    memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
+    if (s->avctx->palctrl->palette_changed) {
+        s->frame.palette_has_changed = 1;
+        s->avctx->palctrl->palette_changed = 0;
+    }
+
     while (row_ptr >= 0) {
         FETCH_NEXT_STREAM_BYTE();
         rle_code = stream_byte;
@@ -128,13 +135,6 @@
         }
     }
 
-    /* make the palette available */
-    memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
-    if (s->avctx->palctrl->palette_changed) {
-        s->frame.palette_has_changed = 1;
-        s->avctx->palctrl->palette_changed = 0;
-    }
-
     /* one last sanity check on the way out */
     if (stream_ptr < s->size)
         av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n",