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

Reimar Döffinger git at videolan.org
Sun Feb 24 19:49:37 CET 2013


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Wed Feb 13 21:07:55 2013 +0100| [db6e2e848b21d988fb108995387a8c7836da4dc7] | committer: Reimar Döffinger

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 at gmx.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db6e2e848b21d988fb108995387a8c7836da4dc7
---

 libavformat/hls.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 1512122..0b7d050 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;
 



More information about the ffmpeg-cvslog mailing list