mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
flvdec: Check avpriv_mpeg4audio_get_config() return
value before using its output. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b6ffceefb5
commit
5500e65342
1 changed files with 3 additions and 2 deletions
|
|
@ -591,8 +591,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||
return ret;
|
||||
if (st->codec->codec_id == CODEC_ID_AAC) {
|
||||
MPEG4AudioConfig cfg;
|
||||
avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
|
||||
st->codec->extradata_size * 8, 1);
|
||||
if (avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
|
||||
st->codec->extradata_size * 8, 1) >= 0) {
|
||||
st->codec->channels = cfg.channels;
|
||||
if (cfg.ext_sample_rate)
|
||||
st->codec->sample_rate = cfg.ext_sample_rate;
|
||||
|
|
@ -600,6 +600,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||
st->codec->sample_rate = cfg.sample_rate;
|
||||
av_dlog(s, "mp4a config channels %d sample rate %d\n",
|
||||
st->codec->channels, st->codec->sample_rate);
|
||||
}
|
||||
}
|
||||
|
||||
ret = AVERROR(EAGAIN);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue