From b5e94b0abb373e78a811f34967e9414301a7b91f Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 18 Dec 2021 15:48:57 -0800 Subject: [PATCH] FFmpeg: Fix crash when encoding audio with some containers --- CHANGES | 1 + src/feature/ffmpeg/ffmpeg-encoder.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index ade29c80f..2d131b40b 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,7 @@ Emulation fixes: - GBA Memory: Fix misaligned 32-bit I/O loads (fixes mgba.io/i/2307) Other fixes: - Core: Don't attempt to restore rewind diffs past start of rewind + - FFmpeg: Fix crash when encoding audio with some containers Misc: - Core: Suspend runloop when a core crashes - mGUI: Add margin to right-aligned menu text (fixes mgba.io/i/871) diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c index 21f298157..55c874692 100644 --- a/src/feature/ffmpeg/ffmpeg-encoder.c +++ b/src/feature/ffmpeg/ffmpeg-encoder.c @@ -737,7 +737,7 @@ bool _ffmpegWriteAudioFrame(struct FFmpegEncoder* encoder, struct AVFrame* audio #ifdef FFMPEG_USE_PACKET_UNREF av_packet_move_ref(packet, tempPacket); - av_packet_free(&packet); + av_packet_free(&tempPacket); #else av_free_packet(packet); av_freep(&packet);