mirror of https://github.com/mpv-player/mpv
Move allocation to avoid a possible memleak if new_sh_audio fails.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29385 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
6a434d676b
commit
bc8b79a37d
|
@ -225,7 +225,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
|
||||||
switch(codec->codec_type){
|
switch(codec->codec_type){
|
||||||
case CODEC_TYPE_AUDIO:{
|
case CODEC_TYPE_AUDIO:{
|
||||||
int override_tag;
|
int override_tag;
|
||||||
WAVEFORMATEX *wf= calloc(sizeof(WAVEFORMATEX) + codec->extradata_size, 1);
|
WAVEFORMATEX *wf;
|
||||||
sh_audio_t* sh_audio;
|
sh_audio_t* sh_audio;
|
||||||
sh_audio=new_sh_audio(demuxer, i);
|
sh_audio=new_sh_audio(demuxer, i);
|
||||||
mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "lavf", i);
|
mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "lavf", i);
|
||||||
|
@ -233,6 +233,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) {
|
||||||
break;
|
break;
|
||||||
priv->astreams[priv->audio_streams] = i;
|
priv->astreams[priv->audio_streams] = i;
|
||||||
priv->audio_streams++;
|
priv->audio_streams++;
|
||||||
|
wf= calloc(sizeof(WAVEFORMATEX) + codec->extradata_size, 1);
|
||||||
// For some formats (like PCM) always trust CODEC_ID_* more than codec_tag
|
// For some formats (like PCM) always trust CODEC_ID_* more than codec_tag
|
||||||
override_tag= av_codec_get_tag(mp_wav_override_taglists, codec->codec_id);
|
override_tag= av_codec_get_tag(mp_wav_override_taglists, codec->codec_id);
|
||||||
if (override_tag)
|
if (override_tag)
|
||||||
|
|
Loading…
Reference in New Issue