From e1ae2d4f4b1acd981da3fcf4355a1661f1b40b61 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 16 Oct 2004 00:42:41 +0000 Subject: [PATCH] fix crash at loop --- stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp index 43dfa95ac7..52573879d8 100644 --- a/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp +++ b/stepmania/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp @@ -322,10 +322,13 @@ int FFMpeg_Helper::DecodePacket() int got_frame; CHECKPOINT; + /* Hack: we need to send size = 0 to flush frames at the end, but we have + * to give it a buffer to read from since it tries to read anyway. */ + static uint8_t dummy[FF_INPUT_BUFFER_PADDING_SIZE] = { 0 }; int len = avcodec::avcodec_decode_video( &m_stream->codec, &frame, &got_frame, - pkt.data, pkt.size ); + pkt.size? pkt.data:dummy, pkt.size ); CHECKPOINT; if (len < 0)