Merge pull request #4285 from RisingFog/its_a_curse_to_recurse

Fix frame dump crash when resolution changes
This commit is contained in:
shuffle2 2016-10-03 18:49:44 -07:00 committed by GitHub
commit 4573cc89fa
1 changed files with 6 additions and 2 deletions

View File

@ -183,10 +183,14 @@ static void PreparePacket(AVPacket* pkt)
void AVIDump::AddFrame(const u8* data, int width, int height)
{
// Store current frame data in case frame dumping stops before next frame update
// Store current frame data in case frame dumping stops before next frame update,
// but make sure that you don't store the last stored frame and check the resolution upon
// closing the file or else you store recusion, and dolphins don't like recursion.
if (!s_stop_dumping)
{
StoreFrameData(data, width, height);
CheckResolution(width, height);
CheckResolution(width, height);
}
s_src_frame->data[0] = const_cast<u8*>(data);
s_src_frame->linesize[0] = width * s_bytes_per_pixel;
s_src_frame->format = s_pix_fmt;