diff mbox

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

Message ID 20190621144119.21603-1-derek.buitenhuis@gmail.com
State Accepted
Commit d5a6b390ced64cfd33764930f8b1d3c6437a43b6
Headers show

Commit Message

Derek Buitenhuis June 21, 2019, 2:41 p.m. UTC
This packet was not necessarily unreferenced.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 fftools/ffprobe.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

James Almer June 21, 2019, 3:09 p.m. UTC | #1
On 6/21/2019 11:41 AM, Derek Buitenhuis wrote:
> This packet was not necessarily unreferenced.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
>  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(&pkt);
>      }
> -    av_init_packet(&pkt);
> -    pkt.data = NULL;
> -    pkt.size = 0;
> +    av_packet_unref(&pkt);
>      //Flush remaining frames that are cached in the decoder
>      for (i = 0; i < fmt_ctx->nb_streams; i++) {
>          pkt.stream_index = i;

LGTM.
diff mbox

Patch

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(&pkt);
     }
-    av_init_packet(&pkt);
-    pkt.data = NULL;
-    pkt.size = 0;
+    av_packet_unref(&pkt);
     //Flush remaining frames that are cached in the decoder
     for (i = 0; i < fmt_ctx->nb_streams; i++) {
         pkt.stream_index = i;