From db6e2e848b21d988fb108995387a8c7836da4dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 13 Feb 2013 21:07:55 +0100 Subject: [PATCH] hls: do not access pb->opaque for custom IO. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- libavformat/hls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 1512122410..0b7d050a5e 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -475,7 +475,7 @@ reload: 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; int ret = 0, i, j, stream_offset = 0;