Prevent NULL dereferences when missing the reference frame in the xan decoder.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 27 Sep 2011 21:43:57 +0000 (23:43 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Sep 2011 22:49:25 +0000 (00:49 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/xan.c

index 3e950f1..506957c 100644 (file)
@@ -222,6 +222,8 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s,
 
     palette_plane = s->current_frame.data[0];
     prev_palette_plane = s->last_frame.data[0];
+    if (!prev_palette_plane)
+        prev_palette_plane = palette_plane;
     stride = s->current_frame.linesize[0];
     line_inc = stride - width;
     curframe_index = y * stride + x;