From 09b97f48268ce10e22fb18082cfdbf35e93e7b2c Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 30 May 2008 15:20:42 +0000 Subject: Handle NULL control function in cache_execute_control, fixes crash with http urls. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26929 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/cache2.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'stream') diff --git a/stream/cache2.c b/stream/cache2.c index 11d6574cf2..e0dba9936c 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -200,6 +200,13 @@ int cache_fill(cache_vars_t* s){ static void cache_execute_control(cache_vars_t *s) { static unsigned last; + if (!s->stream->control) { + s->stream_time_length = 0; + s->control_new_pos = 0; + s->control_res = STREAM_UNSUPPORTED; + s->control = -1; + return; + } if (GetTimerMS() - last > 99) { double len; if (s->stream->control(s->stream, STREAM_CTRL_GET_TIME_LENGTH, &len) == STREAM_OK) -- cgit v1.2.3