Browse Source

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>
tags/n2.6
wm4 Michael Niedermayer 11 years ago
parent
commit
4bf3fab281
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      libavformat/hls.c

+ 3
- 3
libavformat/hls.c 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;


Loading…
Cancel
Save