1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

hls: fix a null pointer dereference

Not allocating the pls->ctx will crash in libavformat/hls.c:1410, where
it tries to dereference the field.

Sample: http://ec24.rtp.pt/liverepeater/rtpn.smil/playlist.m3u8

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
wm4 2015-02-16 19:31:42 +01:00 committed by Michael Niedermayer
parent bf99068089
commit 4bf3fab281

View File

@ -1313,14 +1313,14 @@ static int hls_read_header(AVFormatContext *s)
struct playlist *pls = c->playlists[i];
AVInputFormat *in_fmt = NULL;
if (pls->n_segments == 0)
continue;
if (!(pls->ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (pls->n_segments == 0)
continue;
pls->index = i;
pls->needed = 1;
pls->parent = s;