From 6b0565e5b8f4a39e8348cbb61c21727d098013a5 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Tue, 27 Sep 2011 23:43:57 +0200 Subject: [PATCH] Prevent NULL dereferences when missing the reference frame in the xan decoder. Signed-off-by: Michael Niedermayer (cherry picked from commit 19e95b88459e879d3e67a66350d937c32ed762ca) --- libavcodec/xan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 357593bf2d..404f4d10c6 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -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;