From 184e5f86cea9a0c92a660fe4d33f0aad701d29d7 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 2 May 2019 21:15:37 +0000 Subject: ffmpeg: fixed freezing on some corrupted files git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8837 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp index 83b26ac5b..662c403db 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp @@ -452,14 +452,17 @@ void DecoderFFmpeg::fillBuffer() if(m_pkt.stream_index != audioIndex) { + m_temp_pkt.size = 0; if(m_pkt.data) + { #if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57,24,102)) //ffmpeg-3.0 av_packet_unref(&m_pkt); #else av_free_packet(&m_pkt); #endif - m_temp_pkt.size = 0; - continue; + continue; + } + return; } if(m_seekTime && c->codec_id == AV_CODEC_ID_APE) -- cgit v1.2.3-13-gbd6f