From a14c025e6e7bec4b731366a1703f18604d6c70ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Mon, 1 Oct 2007 23:21:23 +0200 Subject: Fix allocation of 0x0 frame when frame size is still unknown. When a stream doesn't start with an IDR frame, then frame size isn't known, but all frames up to an IDR frame are reported as bad frames. In such a case, a frame of size 1x1 will be allocated as xine-lib cannot handle 0x0 frames properly, i. e. many output drivers simply crash. --- src/libffmpeg/ff_video_decoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libffmpeg') diff --git a/src/libffmpeg/ff_video_decoder.c b/src/libffmpeg/ff_video_decoder.c index 81ee6148e..ccce9c578 100644 --- a/src/libffmpeg/ff_video_decoder.c +++ b/src/libffmpeg/ff_video_decoder.c @@ -1294,10 +1294,10 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { } if (!got_one_picture) { - /* skipped frame, output a bad frame */ + /* skipped frame, output a bad frame (of size 1x1 when size still uninitialized) */ img = this->stream->video_out->get_frame (this->stream->video_out, - this->bih.biWidth, - this->bih.biHeight, + (this->bih.biWidth <= 0) ? 1 : this->bih.biWidth, + (this->bih.biHeight <= 0) ? 1 : this->bih.biHeight, this->aspect_ratio, this->output_format, VO_BOTH_FIELDS|this->frame_flags); -- cgit v1.2.3