mirror of
https://github.com/k4yt3x/video2x.git
synced 2024-12-26 22:09:09 +00:00
fix(libvideo2x): added missing checks around freeing memory
Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
parent
561671c4cb
commit
980b44bc05
@ -62,8 +62,14 @@ static int process_frames(
|
||||
|
||||
// Lambda function for cleaning up resources
|
||||
auto cleanup = [&]() {
|
||||
av_frame_free(&frame);
|
||||
av_packet_free(&packet);
|
||||
if (frame) {
|
||||
av_frame_free(&frame);
|
||||
frame = nullptr;
|
||||
}
|
||||
if (packet) {
|
||||
av_packet_free(&packet);
|
||||
packet = nullptr;
|
||||
}
|
||||
for (AVFrame *&flushed_frame : flushed_frames) {
|
||||
if (flushed_frame) {
|
||||
av_frame_free(&flushed_frame);
|
||||
|
Loading…
Reference in New Issue
Block a user