Commit 9485190152 for ffmpeg
commit 948519015250476d04e544a2a6bf06be5eb44e46
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue Nov 10 11:07:51 2026 +0000
avformat/dss: release packets dropped while seeking
The seek walk calls the packet reader directly. Unreference the packet on FFERROR_REDO before reading the next frame, as the ordinary demux loop does. Otherwise av_new_packet overwrites the buffer reference and leaks one packet for each skipped frame.
Assisted-by: Fairy
diff --git a/libavformat/dss.c b/libavformat/dss.c
index 9e7488869c..2be4efa6bc 100644
--- a/libavformat/dss.c
+++ b/libavformat/dss.c
@@ -569,8 +569,10 @@ static int dss_read_seek(AVFormatContext *s, int stream_index,
return AVERROR(ENOMEM);
while ((ret = dss_read_packet(s, pkt)) >= 0 || ret == FFERROR_REDO) {
- if (ret < 0)
+ if (ret < 0) {
+ av_packet_unref(pkt);
continue;
+ }
av_packet_unref(ctx->seek_pkt);
av_packet_move_ref(ctx->seek_pkt, pkt);
if (ctx->seek_pkt->pts + ctx->seek_pkt->duration > timestamp)