diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 464e4dcb0a083018f639fae330751b1f2b288774..be0c950322d18ce7c4158f7a8c970b8af15f6634 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -567,6 +567,10 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, ics->group_len[w] = wi[ch].grouping[w]; apply_window_and_mdct(s, &cpe->ch[ch], overlap); + if (isnan(cpe->ch->coeffs[0])) { + av_log(avctx, AV_LOG_ERROR, "Input contains NaN\n"); + return AVERROR(EINVAL); + } } start_ch += chans; }