Mercurial > mplayer.hg
comparison libmpcodecs/vd_ffmpeg.c @ 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 | 389d43c448b3 |
children | b14ea6320969 |
comparison
equal
deleted
inserted
replaced
36072:506cefd8a5f0 | 36073:01f4eea55d75 |
---|---|
471 const AVFrame *src, int offset[4], | 471 const AVFrame *src, int offset[4], |
472 int y, int type, int height){ | 472 int y, int type, int height){ |
473 sh_video_t *sh = s->opaque; | 473 sh_video_t *sh = s->opaque; |
474 uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]}; | 474 uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]}; |
475 int strides[MP_MAX_PLANES] = {src->linesize[0], src->linesize[1], src->linesize[2]}; | 475 int strides[MP_MAX_PLANES] = {src->linesize[0], src->linesize[1], src->linesize[2]}; |
476 if (!src->data[0]) { | |
477 mp_msg(MSGT_DECVIDEO, MSGL_FATAL, "BUG in FFmpeg, draw_slice called with NULL pointer!\n"); | |
478 return; | |
479 } | |
476 if (height < 0) | 480 if (height < 0) |
477 { | 481 { |
478 int i; | 482 int i; |
479 height = -height; | 483 height = -height; |
480 y -= height; | 484 y -= height; |