aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2024-08-16 02:01:12 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2024-08-16 20:22:09 +0200
commit817c6a6762696e6efee44ddc4e2d706922b880e0 (patch)
tree1b3ca1fd334a8be970a922310823ddb77113acb9 /libavformat/hlsenc.c
parent211c88b9d5f10e8ad53a2d9d786ab07bae6a2a8e (diff)
downloadffmpeg-817c6a6762696e6efee44ddc4e2d706922b880e0.tar.gz
avformat/hlsenc: correctly reset subtitle stream counter per-varstream
Without resetting it, if there was a previous set of varstreams with subtitles, it would subtract from all the streams, leading to chaos and segfaults when trying to access for example stream -1.
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 6d6ede1b6f..1e932b7b0e 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2441,7 +2441,6 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
int is_ref_pkt = 1;
int ret = 0, can_split = 1, i, j;
int stream_index = 0;
- int subtitle_streams = 0;
int range_length = 0;
const char *proto = NULL;
int use_temp_file = 0;
@@ -2449,6 +2448,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
char *old_filename = NULL;
for (i = 0; i < hls->nb_varstreams; i++) {
+ int subtitle_streams = 0;
vs = &hls->var_streams[i];
for (j = 0; j < vs->nb_streams; j++) {
if (vs->streams[j]->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) {