diff mbox series

[FFmpeg-devel] avcodec/pthread_frame: Fix leak of coded side data

Message ID AS8P250MB074421A8A6E4A084EDCB7C8D8F0E2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 277f051ff6a9c25a8bbfee3e69f74632d0d83252
Headers show
Series [FFmpeg-devel] avcodec/pthread_frame: Fix leak of coded side data | expand

Checks

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

Andreas Rheinhardt April 18, 2024, 9:30 p.m. UTC
Happens in the mov-elst-ends-betn-b-and-i FATE test with
frame-threading.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/pthread_frame.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andreas Rheinhardt April 20, 2024, 1:50 p.m. UTC | #1
Andreas Rheinhardt:
> Happens in the mov-elst-ends-betn-b-and-i FATE test with
> frame-threading.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/pthread_frame.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index f19571f6f8..a984ff94d5 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -731,6 +731,8 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
>              av_packet_free(&ctx->internal->last_pkt_props);
>              av_freep(&ctx->internal);
>              av_buffer_unref(&ctx->hw_frames_ctx);
> +            av_frame_side_data_free(&ctx->decoded_side_data,
> +                                    &ctx->nb_decoded_side_data);
>          }
>  
>          av_frame_free(&p->frame);

Will apply this patch tomorrow unless there are objections.

- Andreas
James Almer April 20, 2024, 3:19 p.m. UTC | #2
On 4/18/2024 6:30 PM, Andreas Rheinhardt wrote:
> Happens in the mov-elst-ends-betn-b-and-i FATE test with
> frame-threading.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>   libavcodec/pthread_frame.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index f19571f6f8..a984ff94d5 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -731,6 +731,8 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
>               av_packet_free(&ctx->internal->last_pkt_props);
>               av_freep(&ctx->internal);
>               av_buffer_unref(&ctx->hw_frames_ctx);
> +            av_frame_side_data_free(&ctx->decoded_side_data,
> +                                    &ctx->nb_decoded_side_data);

LGTM.
diff mbox series

Patch

diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index f19571f6f8..a984ff94d5 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -731,6 +731,8 @@  void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
             av_packet_free(&ctx->internal->last_pkt_props);
             av_freep(&ctx->internal);
             av_buffer_unref(&ctx->hw_frames_ctx);
+            av_frame_side_data_free(&ctx->decoded_side_data,
+                                    &ctx->nb_decoded_side_data);
         }
 
         av_frame_free(&p->frame);