Commit 5500e653 authored by Michael Niedermayer's avatar Michael Niedermayer

flvdec: Check avpriv_mpeg4audio_get_config() return

value before using its output.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b6ffceef
...@@ -591,8 +591,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -591,8 +591,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret; return ret;
if (st->codec->codec_id == CODEC_ID_AAC) { if (st->codec->codec_id == CODEC_ID_AAC) {
MPEG4AudioConfig cfg; MPEG4AudioConfig cfg;
avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata, if (avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
st->codec->extradata_size * 8, 1); st->codec->extradata_size * 8, 1) >= 0) {
st->codec->channels = cfg.channels; st->codec->channels = cfg.channels;
if (cfg.ext_sample_rate) if (cfg.ext_sample_rate)
st->codec->sample_rate = cfg.ext_sample_rate; st->codec->sample_rate = cfg.ext_sample_rate;
...@@ -601,6 +601,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -601,6 +601,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
av_dlog(s, "mp4a config channels %d sample rate %d\n", av_dlog(s, "mp4a config channels %d sample rate %d\n",
st->codec->channels, st->codec->sample_rate); st->codec->channels, st->codec->sample_rate);
} }
}
ret = AVERROR(EAGAIN); ret = AVERROR(EAGAIN);
goto leave; goto leave;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment