[FFmpeg-devel] [PATCH] hls: do not access pb->opaque for custom IO.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Feb 24 17:21:40 CET 2013


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 at gmx.de>
---
 libavformat/hls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 6f9e29d..26e1042 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -476,7 +476,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;
 
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list