[FFmpeg-cvslog] msrle: fix regression causing null ptr dereference

Michael Niedermayer git at videolan.org
Sat Aug 11 02:25:31 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Aug 11 02:20:06 2012 +0200| [58825a18aacca2e703e969cb064113dbb0e04b07] | committer: Michael Niedermayer

msrle: fix regression causing null ptr dereference

Fixes Ticket1630

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58825a18aacca2e703e969cb064113dbb0e04b07
---

 libavcodec/msrle.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c
index 2a9d95a..7c965d2 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;



More information about the ffmpeg-cvslog mailing list