mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-06 18:00:17 +00:00
avcodec/aacenc: Tighter input checks
Fixes occurance of NaN/Inf leading to assertion failures and out of array access
Fixes: d1c38a09acc34845c6be3a127a5aacaf/signal_sigsegv_3982225_6121_d18bd5451d4245ee09408f04badd1b83.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 77bf96b047)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
2858f77fd4
commit
cd91aaa4cc
1 changed files with 2 additions and 2 deletions
|
|
@ -609,8 +609,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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue