From 6ea4633f0759d87f3af70ee404a6b1ddb6f748d5 Mon Sep 17 00:00:00 2001
From: Daniel Kang <daniel.d.kang@gmail.com>
Date: Sun, 9 Jan 2011 18:14:44 -0500
Subject: [PATCH] Check for interplay video invalid decode type

---
 libavcodec/interplayvideo.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c
index b98386f..34f0557 100644
--- a/libavcodec/interplayvideo.c
+++ b/libavcodec/interplayvideo.c
@@ -99,6 +99,10 @@ static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y)
             motion_offset, s->upper_motion_limit_offset);
         return -1;
     }
+    if (src->data[0] == NULL) {
+        av_log(s->avctx, AV_LOG_ERROR, "Invalid decode type, corrupted header?\n");
+        return AVERROR(EINVAL);
+    }
     s->dsp.put_pixels_tab[!s->is_16bpp][0](s->pixel_ptr, src->data[0] + motion_offset,
                                            s->current_frame.linesize[0], 8);
     return 0;
--
1.7.2.2
