History

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.

Timo Rothenpieler committed 2 years ago

Commit 817c6a61 parent 211c88b1 file · +1 −1Browse files

Unified · Split

libavformat/hlsenc.c+1−1
@@ -2441,7 +2441,6 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) · 2440 unmodified lines
24412441 int is_ref_pkt = 1;
24422442 int ret = 0, can_split = 1, i, j;
24432443 int stream_index = 0;
2444− int subtitle_streams = 0;
24452444 int range_length = 0;
24462445 const char *proto = NULL;
24472446 int use_temp_file = 0;
@@ -2449,6 +2448,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) · 1 unmodified line
24492448 char *old_filename = NULL;
24502449
24512450 for (i = 0; i < hls->nb_varstreams; i++) {
2451+ int subtitle_streams = 0;
24522452 vs = &hls->var_streams[i];
24532453 for (j = 0; j < vs->nb_streams; j++) {
24542454 if (vs->streams[j]->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t