summaryrefslogtreecommitdiff
path: root/src/libffmpeg/ff_video_decoder.c
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2007-10-01 23:21:23 +0200
committerReinhard Nißl <rnissl@gmx.de>2007-10-01 23:21:23 +0200
commita14c025e6e7bec4b731366a1703f18604d6c70ac (patch)
treedf975d1ac26e270331e7d18b413969262251871f /src/libffmpeg/ff_video_decoder.c
parent11c825b340cc7ac470e32b992aa64cf3ec50b4ce (diff)
downloadxine-lib-a14c025e6e7bec4b731366a1703f18604d6c70ac.tar.gz
xine-lib-a14c025e6e7bec4b731366a1703f18604d6c70ac.tar.bz2
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.
Diffstat (limited to 'src/libffmpeg/ff_video_decoder.c')
-rw-r--r--src/libffmpeg/ff_video_decoder.c6
1 files changed, 3 insertions, 3 deletions
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);