summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/aacenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index e1a2d4544b..9e421a9aaa 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -622,8 +622,8 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
}
for (k = 0; k < 1024; k++) {
- if (!isfinite(cpe->ch[ch].coeffs[k])) {
- av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n");
+ if (!(fabs(cpe->ch[ch].coeffs[k]) < 1E16)) { // Ensure headroom for energy calculation
+ av_log(avctx, AV_LOG_ERROR, "Input contains (near) NaN/+-Inf\n");
return AVERROR(EINVAL);
}
}