changeset 36073:01f4eea55d75

Detect invalid data from FFmpeg. Fixes the crash part of bug #2135.
author reimar
date Fri, 05 Apr 2013 13:46:51 +0000
parents 506cefd8a5f0
children fbbf13706c50
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Fri Apr 05 12:43:11 2013 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Fri Apr 05 13:46:51 2013 +0000
@@ -473,6 +473,10 @@
     sh_video_t *sh = s->opaque;
     uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
     int strides[MP_MAX_PLANES] = {src->linesize[0], src->linesize[1], src->linesize[2]};
+    if (!src->data[0]) {
+        mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "BUG in FFmpeg, draw_slice called with NULL pointer!\n");
+        return;
+    }
     if (height < 0)
     {
         int i;