OSDN Git Service

hls: do not access pb->opaque for custom IO.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 13 Feb 2013 20:07:55 +0000 (21:07 +0100)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Sun, 24 Feb 2013 18:49:06 +0000 (19:49 +0100)
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>
libavformat/hls.c

index 1512122..0b7d050 100644 (file)
@@ -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;