From 55478af832a8efa3f5125e140d2460a1ff6b18a7 Mon Sep 17 00:00:00 2001 From: Chris Burgener Date: Mon, 3 Oct 2016 18:48:29 -0400 Subject: [PATCH] Fix frame dump crash when resolution changes --- Source/Core/VideoCommon/AVIDump.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp index cb38026f7d..8c6c8d6a1b 100644 --- a/Source/Core/VideoCommon/AVIDump.cpp +++ b/Source/Core/VideoCommon/AVIDump.cpp @@ -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(data); s_src_frame->linesize[0] = width * s_bytes_per_pixel; s_src_frame->format = s_pix_fmt;