Re: [FFmpeg-devel] [PATCH v3] ffprobe: Fix memory leak

2019-06-21 Thread James Almer
On 6/21/2019 11:41 AM, Derek Buitenhuis wrote:
> This packet was not necessarily unreferenced.
> 
> Signed-off-by: Derek Buitenhuis 
> ---
>  fftools/ffprobe.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index 3becb6330e..5aaddb0308 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -2429,9 +2429,7 @@ static int read_interval_packets(WriterContext *w, 
> InputFile *ifile,
>  }
>  av_packet_unref();
>  }
> -av_init_packet();
> -pkt.data = NULL;
> -pkt.size = 0;
> +av_packet_unref();
>  //Flush remaining frames that are cached in the decoder
>  for (i = 0; i < fmt_ctx->nb_streams; i++) {
>  pkt.stream_index = i;

LGTM.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH v3] ffprobe: Fix memory leak

2019-06-21 Thread Derek Buitenhuis
This packet was not necessarily unreferenced.

Signed-off-by: Derek Buitenhuis 
---
 fftools/ffprobe.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 3becb6330e..5aaddb0308 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2429,9 +2429,7 @@ static int read_interval_packets(WriterContext *w, 
InputFile *ifile,
 }
 av_packet_unref();
 }
-av_init_packet();
-pkt.data = NULL;
-pkt.size = 0;
+av_packet_unref();
 //Flush remaining frames that are cached in the decoder
 for (i = 0; i < fmt_ctx->nb_streams; i++) {
 pkt.stream_index = i;
-- 
2.20.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".