hls: do not access pb->opaque for custom IO.

As the name indicates we can't just assume what the
"opaque" field contains.
This fixes a crash in third-party applications see e.g.:
http://bugzilla.mplayerhq.hu/show_bug.cgi?id=2126

This fixes also FFmpeg trac #2293, which is a different
third-party application.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
Reimar Döffinger 2013-02-13 21:07:55 +01:00
parent 036df234fb
commit db6e2e848b
1 changed files with 1 additions and 1 deletions

View File

@ -475,7 +475,7 @@ reload:
static int hls_read_header(AVFormatContext *s) static int hls_read_header(AVFormatContext *s)
{ {
URLContext *u = s->pb->opaque; URLContext *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb->opaque;
HLSContext *c = s->priv_data; HLSContext *c = s->priv_data;
int ret = 0, i, j, stream_offset = 0; int ret = 0, i, j, stream_offset = 0;