lavc/mpeg4audio: add chan_config check to avoid indeterminate channels
add chan_config check to avoid indeterminate channels.
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 333109f469
)
This commit is contained in:
@ -93,6 +93,10 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
|
|||||||
c->chan_config = get_bits(gb, 4);
|
c->chan_config = get_bits(gb, 4);
|
||||||
if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
|
if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
|
||||||
c->channels = ff_mpeg4audio_channels[c->chan_config];
|
c->channels = ff_mpeg4audio_channels[c->chan_config];
|
||||||
|
else {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "Invalid chan_config %d\n", c->chan_config);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
c->sbr = -1;
|
c->sbr = -1;
|
||||||
c->ps = -1;
|
c->ps = -1;
|
||||||
if (c->object_type == AOT_SBR || (c->object_type == AOT_PS &&
|
if (c->object_type == AOT_SBR || (c->object_type == AOT_PS &&
|
||||||
|
Reference in New Issue
Block a user