Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforge.net>2011-03-03 01:15:15 +0300
committerJustin Maggard <jmaggard@users.sourceforge.net>2011-03-03 01:15:15 +0300
commit1f4422c3224581e128b27d61f25d0966170ad6ec (patch)
tree436d7f4c0d17ac9f4f5a265396c98cc5557889ca
parenta88fe04979270fab38313bd3187be7417ffa918f (diff)
* Fix a bad free with some video files with AAC audio.
-rw-r--r--metadata.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/metadata.c b/metadata.c
index 615d792..13cfe6e 100644
--- a/metadata.c
+++ b/metadata.c
@@ -1075,29 +1075,37 @@ 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:
- 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");
- break;
- }
- default:
+ off += sprintf(m.dlna_pn+off, "AMR");
+ }
+ 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");
+ }
+ 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;
+ }
+ }
+ 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;
}
}
else if( ctx->streams[video_stream]->codec->width <= 720 &&