[FFmpeg-devel] [PATCH 1/2] ffmpeg: unref ist->filter_frame in the only place it's used

James Almer jamrial at gmail.com
Fri Nov 19 17:48:55 EET 2021


Signed-off-by: James Almer <jamrial at gmail.com>
---
 fftools/ffmpeg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index e88ca554ae..a67f489cda 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2326,6 +2326,7 @@ static int send_frame_to_filters(InputStream *ist, AVFrame *decoded_frame)
             break;
         }
     }
+    av_frame_unref(ist->filter_frame);
     return ret;
 }
 
@@ -2385,7 +2386,6 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
     ist->nb_samples = decoded_frame->nb_samples;
     err = send_frame_to_filters(ist, decoded_frame);
 
-    av_frame_unref(ist->filter_frame);
     av_frame_unref(decoded_frame);
     return err < 0 ? err : ret;
 }
@@ -2511,7 +2511,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
     err = send_frame_to_filters(ist, decoded_frame);
 
 fail:
-    av_frame_unref(ist->filter_frame);
     av_frame_unref(decoded_frame);
     return err < 0 ? err : ret;
 }
-- 
2.33.0



More information about the ffmpeg-devel mailing list