microsoft / FFmpegInterop

This is a code sample to make it easier to use FFmpeg in Windows applications.
Apache License 2.0
1.29k stars 310 forks source link

WP8.1 crash with FFMPEG 3 #117

Closed brabebhin closed 6 months ago

brabebhin commented 7 years ago

The following crash occurs from time to time with different files

The thread tried to read or write to a virtual address to which it did not have access to.

So far I did not find the same issue on W10.

Stack trace: msvcr120_app.dll!5ad712de() Unknown avutil-55.dll!av_frame_move_ref(AVFrame dst, AVFrame src) Line 525 C avcodec-57.dll!avcodec_receive_frame(AVCodecContext avctx, AVFrame frame) Line 2928 C ffmpegWindowsPhone.dll!FFmpegInterop::UncompressedSampleProvider::GetFrameFromFFmpegDecoder(AVPacket avPacket) Line 61 C++ ffmpegWindowsPhone.dll!FFmpegInterop::UncompressedSampleProvider::[FFmpegInterop::MediaSampleProvider]::DecodeAVPacket(Windows::Storage::Streams::DataWriter ^ dataWriter, AVPacket avPacket, int64 & framePts, int64 & frameDuration) Line 96 C++

ffmpegWindowsPhone.dll!FFmpegInterop::MediaSampleProvider::GetNextSample() Line 102 C++ ffmpegWindowsPhone.dll!FFmpegInterop::FFmpegInteropMSS::OnSampleRequested(Windows::Media::Core::MediaStreamSource ^ sender, Windows::Media::Core::MediaStreamSourceSampleRequestedEventArgs ^ args) Line 667 C++

The exact line of code at which it crashes is

if (SUCCEEDED(hr)) { AVFrame *pFrame = av_frame_alloc(); // Try to get a frame from the decoder. decodeFrame = avcodec_receive_frame(m_pAvCodecCtx, pFrame);

pFrame seems to be NULLPTR.