From 1fa33a5be38af8f754a1673d6f0451a0d2733591 Mon Sep 17 00:00:00 2001 From: Alf Date: Fri, 18 Dec 2020 20:37:25 -0800 Subject: [PATCH] Forgot to cleanup ffmpeg memory allocations in get_file_info and get_frames. --- src/ffprobe-wasm-wrapper.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ffprobe-wasm-wrapper.cpp b/src/ffprobe-wasm-wrapper.cpp index 790deba..5e72047 100644 --- a/src/ffprobe-wasm-wrapper.cpp +++ b/src/ffprobe-wasm-wrapper.cpp @@ -131,6 +131,7 @@ FileInfoResponse get_file_info() { r.streams.push_back(stream); free(fourcc); } + avformat_close_input(&pFormatContext); return r; } @@ -230,7 +231,12 @@ FramesResponse get_frames(int offset) { } frame_count++; } + av_packet_unref(pPacket); } + avformat_close_input(&pFormatContext); + av_packet_free(&pPacket); + av_frame_free(&pFrame); + avcodec_free_context(&pCodecContext); return r; }