[opus] Aborting on NaN in CELT - what are the conditions for crash in transient_analysis

Alexandr Petak alexandr.petak at gmail.com
Fri Jun 29 14:53:06 UTC 2018

in this commit in celt_encoder.c

I see the note:
+      /* We should never see NaNs here. If we find any, then
something really bad happened and we better abort
+         before it does any damage later on. If these asserts are
disabled (no hardening), then the table
+         lookup a few lines below (id = ...) is likely to crash dur
to an out-of-bounds read. DO NOT FIX
+         that crash on NaN since it could result in a worse issue later on. */

I think I'm exactly in that situation. Opus codec crashes occasionally for
me with Access violation in the transient_analysis function on the line
where it's computing the id from the floating point.

 id = (int)MAX32(0,MIN32(127,floor(64*norm*(tmp[i]+EPSILON))));

Could you please provide more info about what could be the crash reason

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20180629/db780dbb/attachment-0001.html>

More information about the opus mailing list