diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index 2a9d95ad70af33e5440428b79a8556482e1353e2..7c965d25e2a4534f75dd3b45d2d5d5d88fdbe025 100644
--- a/libavcodec/msrle.c
+++ b/libavcodec/msrle.c
@@ -106,11 +106,10 @@ static int msrle_decode_frame(AVCodecContext *avctx,
             s->frame.palette_has_changed = 1;
             memcpy(s->pal, pal, AVPALETTE_SIZE);
         }
+        /* make the palette available */
+        memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
     }
 
-    /* make the palette available */
-    memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
-
     /* FIXME how to correctly detect RLE ??? */
     if (avctx->height * istride == avpkt->size) { /* assume uncompressed */
         int linesize = (avctx->width * avctx->bits_per_coded_sample + 7) / 8;