Fix crash with no location in iTunes xml

This commit is contained in:
Ron Pedde 2006-07-19 05:13:08 +00:00
parent 916ad55eb5
commit ca259e8e12
2 changed files with 10 additions and 2 deletions

View File

@ -429,7 +429,13 @@ void rsp_playlist(WS_CONNINFO *pwsc, PRIVINFO *ppi) {
_ppi->log(E_DBG,"Transcode: %d, %s: %s\n",transcode,row[37],row[2]);
while(rsp_fields[rowindex].name) {
/* dummy up codectype for streaming radio */
if((strcmp(row[27],"1") == 0)&&(rowindex == 37)) {
xml_output(pxml,rsp_fields[rowindex].name,"mpeg");
} /* count on the fact that codectype is otherwise null */
if((rsp_fields[rowindex].flags & type) &&
(row[rowindex] && strlen(row[rowindex]))) {
if(transcode) {

View File

@ -182,13 +182,15 @@ int scan_xml_translate_path(char *pold, char *pnew) {
static int discard;
char base_path[PATH_MAX];
char working_path[PATH_MAX];
char *current = pold + strlen(pold);
char *current;
char *pbase;
char *ptemp;
if((!pold)||(!strlen(pold)))
return FALSE;
current = pold + strlen(pold);
/* see if it's a valid out-of-root path */
if(strncmp(pold,"file://localhost/",17)==0) {
/* it's a local path.. is it a valid one? */
@ -678,7 +680,7 @@ int scan_xml_tracks_section(int action, char *info) {
state = XML_TRACK_ST_MAIN_DICT;
/* but more importantly, we gotta process the track */
is_streaming = 0;
if(strncasecmp(song_path,"http://",7) == 0)
if((song_path) && strncasecmp(song_path,"http://",7) == 0)
is_streaming = 1;
if((!is_streaming)&&scan_xml_translate_path(song_path,real_path)) {