[FFmpeg-devel] [PATCH V1] lavc/mpeg4audio: add chan_config check to avoid indeterminate channels
James Almer
jamrial at gmail.com
Sat Sep 21 18:11:36 EEST 2019
On 9/21/2019 8:29 AM, Jun Zhao wrote:
> From: Jun Zhao <barryjzhao at tencent.com>
>
> add chan_config check to avoid indeterminate channels.
>
> Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
> ---
> libavcodec/mpeg4audio.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c
> index 2197147..0ada239 100644
> --- a/libavcodec/mpeg4audio.c
> +++ b/libavcodec/mpeg4audio.c
> @@ -93,6 +93,10 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
> c->chan_config = get_bits(gb, 4);
> if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
> c->channels = ff_mpeg4audio_channels[c->chan_config];
> + else {
> + av_log(NULL, AV_LOG_ERROR, "Invalid chan_config %d\n", c->chan_config);
Is chan_config > 8 invalid, or currently unsupported instead?
> + return -1;
> + }
> c->sbr = -1;
> c->ps = -1;
> if (c->object_type == AOT_SBR || (c->object_type == AOT_PS &&
>
More information about the ffmpeg-devel
mailing list