* Fix a bad free with some video files with AAC audio.

This commit is contained in:
Justin Maggard 2011-03-02 22:15:15 +00:00
parent 2170f6a53b
commit 107b808021

View File

@ -1075,24 +1075,32 @@ GetVideoMetadata(const char * path, char * name)
m.dlna_pn = NULL;
break;
}
switch( audio_profile )
if( audio_profile == PROFILE_AUDIO_AMR )
{
case PROFILE_AUDIO_AMR:
off += sprintf(m.dlna_pn+off, "AMR");
break;
case PROFILE_AUDIO_AAC:
}
else if( audio_profile == PROFILE_AUDIO_AAC )
{
off += sprintf(m.dlna_pn+off, "AAC_");
if( ctx->bit_rate < 540000 )
{
off += sprintf(m.dlna_pn+off, "540");
break;
}
else if( ctx->bit_rate < 940000 )
{
off += sprintf(m.dlna_pn+off, "940");
}
else
{
DPRINTF(E_DEBUG, L_METADATA, "No DLNA profile found for %s file %s\n",
m.dlna_pn, basename(path));
free(m.dlna_pn);
m.dlna_pn = NULL;
break;
}
default:
}
else
{
DPRINTF(E_DEBUG, L_METADATA, "No DLNA profile found for %s file %s\n",
m.dlna_pn, basename(path));
free(m.dlna_pn);