X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fhls.c;h=c16c7708f423c5e7cfc6468043795277c3d093aa;hb=b7601b5f3d164139391ef21d1ba19bf8b22ffa66;hp=4691a605021360bbb2bcf9a1ce1a05928d060f4d;hpb=3cf08e96fc85ec59b9da2dc79dc1eefc67f5c72d;p=ffmpeg diff --git a/libavformat/hls.c b/libavformat/hls.c index 4691a605021..c16c7708f42 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -482,7 +482,9 @@ static void handle_rendition_args(struct rendition_info *info, const char *key, /* used by parse_playlist to allocate a new variant+playlist when the * playlist is detected to be a Media Playlist (not Master Playlist) * and we have no parent Master Playlist (parsing of which would have - * allocated the variant and playlist already) */ + * allocated the variant and playlist already) + * *pls == NULL => Master Playlist or parentless Media Playlist + * *pls != NULL => parented Media Playlist, playlist+variant allocated */ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url) { if (*pls) @@ -493,8 +495,6 @@ static int ensure_playlist(HLSContext *c, struct playlist **pls, const char *url return 0; } -/* pls = NULL => Master Playlist or parentless Media Playlist - * pls = !NULL => parented Media Playlist, playlist+variant allocated */ static int open_in(HLSContext *c, AVIOContext **in, const char *url) { AVDictionary *tmp = NULL; @@ -516,13 +516,15 @@ static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *o av_dict_copy(&tmp, opts, 0); av_dict_copy(&tmp, opts2, 0); - av_opt_set_dict(pls->input, &tmp); + if ((ret = av_opt_set_dict(pls->input, &tmp)) < 0) + goto fail; if ((ret = ffurl_connect(pls->input, NULL)) < 0) { ffurl_close(pls->input); pls->input = NULL; } +fail: av_dict_free(&tmp); return ret; } @@ -1812,7 +1814,7 @@ static int hls_probe(AVProbeData *p) #define FLAGS AV_OPT_FLAG_DECODING_PARAM static const AVOption hls_options[] = { {"live_start_index", "segment index to start live streams at (negative values are from the end)", - OFFSET(live_start_index), FF_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS}, + OFFSET(live_start_index), AV_OPT_TYPE_INT, {.i64 = -3}, INT_MIN, INT_MAX, FLAGS}, {NULL} };