From 5859bca5ac52b8787a96d07e8d5fabd6cecf3195 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 19 Jun 2006 05:47:38 +0000 Subject: [PATCH] Fix crash on no user-agent, fixing ticket #164 --- src/plugin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugin.c b/src/plugin.c index 00b29263..f19e2f98 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -588,10 +588,12 @@ int plugin_ssc_should_transcode(WS_CONNINFO *pwsc, char *codec) { native_codecs = ws_getrequestheader(pwsc,"accept-codecs"); if(!native_codecs) { user_agent = ws_getrequestheader(pwsc,"user-agent"); - if(strncmp(user_agent,"iTunes",6)==0) { - native_codecs = "mpeg,mp4a,wav,mp4v,alac"; - } else if(strncmp(user_agent,"Roku",4)==0) { - native_codecs = "mpeg,mp4a,wav,wma"; + if(user_agent) { + if(strncmp(user_agent,"iTunes",6)==0) { + native_codecs = "mpeg,mp4a,wav,mp4v,alac"; + } else if(strncmp(user_agent,"Roku",4)==0) { + native_codecs = "mpeg,mp4a,wav,wma"; + } } } }