1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

avformat/hlsproto: reject NaN and out of range EXTINF

Fixes: #EXTINF:nan and #EXTINF:1e300
This commit is contained in:
Michael Niedermayer
2026-08-11 03:56:32 +02:00
parent 9bec746fe0
commit f76bd694c3

View File

@@ -142,9 +142,13 @@ static int parse_playlist(URLContext *h, const char *url)
} else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
s->finished = 1;
} else if (av_strstart(line, "#EXTINF:", &ptr)) {
double d = atof(ptr) * AV_TIME_BASE;
if (!(d >= 0 && d < INT64_MAX)) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
is_segment = 1;
duration = atof(ptr) * AV_TIME_BASE;
duration = FFMAX(duration, 0.001 * AV_TIME_BASE);
duration = FFMAX(d, 0.001 * AV_TIME_BASE);
} else if (av_strstart(line, "#", NULL)) {
continue;
} else if (line[0]) {