This packet was not necessarily unreferenced. Signed-off-by: Derek Buitenhuis <derek.buitenh...@gmail.com> --- fftools/ffprobe.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 3becb6330e..52f24e7dfd 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2351,6 +2351,7 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile, int ret = 0, i = 0, frame_count = 0; int64_t start = -INT64_MAX, end = interval->end; int has_start = 0, has_end = interval->has_end && !interval->end_is_offset; + int needs_unref = 0; av_init_packet(&pkt); @@ -2410,9 +2411,12 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile, } if (interval->end_is_offset && interval->duration_frames) { - if (frame_count >= interval->end) + if (frame_count >= interval->end) { + needs_unref = 1; break; + } } else if (has_end && *cur_ts != AV_NOPTS_VALUE && *cur_ts >= end) { + needs_unref = 1; break; } @@ -2429,6 +2433,10 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile, } av_packet_unref(&pkt); } + + if (needs_unref) + av_packet_unref(&pkt); + av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; -- 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".