diff mbox series

[FFmpeg-devel] bsf: Fix memory leak by adding vp9_raw_reorder_frame_free()

Message ID BYAPR03MB41684276AF54D0001610B46CADF82@BYAPR03MB4168.namprd03.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel] bsf: Fix memory leak by adding vp9_raw_reorder_frame_free() | expand


Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Jiasheng Jiang June 4, 2024, 2:46 p.m. UTC
Add vp9_raw_reorder_frame_free() before "ctx->next_frame = NULL;" to avoid memory leak.

Fixes: 887a7817b6 ("lavc: move bitstream filters into bsf/ subdir")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@outlook.com>
 libavcodec/bsf/vp9_raw_reorder.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series


diff --git a/libavcodec/bsf/vp9_raw_reorder.c b/libavcodec/bsf/vp9_raw_reorder.c
index d36093316c..88cf68fb50 100644
--- a/libavcodec/bsf/vp9_raw_reorder.c
+++ b/libavcodec/bsf/vp9_raw_reorder.c
@@ -372,6 +372,7 @@  static int vp9_raw_reorder_filter(AVBSFContext *bsf, AVPacket *out)
         if (err < 0) {
             av_log(bsf, AV_LOG_ERROR, "Failed to create output "
                    "for transient frame.\n");
+            vp9_raw_reorder_frame_free(&frame);
             ctx->next_frame = NULL;
             return AVERROR_INVALIDDATA;