From: <rn...@gm...> - 2007-10-03 18:58:59
|
# HG changeset patch # User Reinhard Nißl <rn...@gm...> # Date 1191273683 -7200 # Node ID 4e3ac9865bc4c3394fd204812b5c5c5be49353ae # Parent bd2d7c2d1fe6c44a95590d3b2eaab9ae75ddc110 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. diff -r 4e3ac9865bc4c3394fd204812b5c5c5be49353ae -r bd2d7c2d1fe6c44a95590d3b2eaab9ae75ddc110 src/libffmpeg/ff_video_decoder.c --- a/src/libffmpeg/ff_video_decoder.c Mon Oct 01 23:21:23 2007 +0200 +++ b/src/libffmpeg/ff_video_decoder.c Wed Sep 19 19:44:53 2007 +0100 @@ -1294,10 +1294,10 @@ static void ff_handle_buffer (ff_video_d } 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); |