[FFmpeg-devel] [PATCH 1/2] avcodec/utils: report insane channel count errors

Michael Niedermayer michael at niedermayer.cc
Wed Jul 4 13:06:27 EEST 2018


On Tue, Jul 03, 2018 at 12:51:11PM +0200, Marton Balint wrote:
> More than 64 is not *that* insane, so let's report the error at least.
> 
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavcodec/utils.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 59d41ccbb6..4ac73fcd92 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -674,6 +674,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
>          av_freep(&avctx->subtitle_header);
>  
>      if (avctx->channels > FF_SANE_NB_CHANNELS) {
> +        av_log(avctx, AV_LOG_ERROR, "Too many channels: %d\n", avctx->channels);
>          ret = AVERROR(EINVAL);
>          goto free_and_end;
>      }

LGTM, if nothing equivalent is otherwise printed

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180704/5db3e2ff/attachment.sig>


More information about the ffmpeg-devel mailing list