[FFmpeg-cvslog] lavc/sbrdsp: fix potential overflow in noise table

Rémi Denis-Courmont git at videolan.org
Sun May 26 14:15:04 EEST 2024


ffmpeg | branch: release/7.0 | Rémi Denis-Courmont <remi at remlab.net> | Sat May 25 21:09:26 2024 +0300| [58ac1f9ea800699fb4ee3aafbd52208103fc405b] | committer: Rémi Denis-Courmont

lavc/sbrdsp: fix potential overflow in noise table

Since the SBR noise application optimisations are currently restricted
to hardware with 128-bit vectors, and use a quadruple multipler, they
can load up to 16 32-bit elements. But the "loads" are of 2 segments,
or 16 pairs of single precision float.

Thus we need to expand the dupiclated section of the noise table from
2x8 to 2x16 to avoid overflows.

(cherry picked from commit e6b38c944f0ed1f28f78fcf0055708c7d208db07)
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58ac1f9ea800699fb4ee3aafbd52208103fc405b
---

 libavcodec/sbrdsp_template.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/sbrdsp_template.c b/libavcodec/sbrdsp_template.c
index c1e583ea56..75cf3dbdfc 100644
--- a/libavcodec/sbrdsp_template.c
+++ b/libavcodec/sbrdsp_template.c
@@ -373,4 +373,10 @@ const attribute_visibility_hidden DECLARE_ALIGNED(16, INTFLOAT, AAC_RENAME(ff_sb
 {Q31( 0.14130051758487f), Q31(-0.95090983575689f)}, {Q31(-0.47005496701697f), Q31(-0.37340549728647f)},
 {Q31( 0.80705063769351f), Q31( 0.29653668284408f)}, {Q31(-0.38981478896926f), Q31( 0.89572605717087f)},
 {Q31(-0.01053049862020f), Q31(-0.66959058036166f)}, {Q31(-0.91266367957293f), Q31(-0.11522938140034f)},
+#if ARCH_RISCV
+{Q31( 0.54840422910309f), Q31( 0.75221367176302f)}, {Q31( 0.40009252867955f), Q31(-0.98929400334421f)},
+{Q31(-0.99867974711855f), Q31(-0.88147068645358f)}, {Q31(-0.95531076805040f), Q31( 0.90908757154593f)},
+{Q31(-0.45725933317144f), Q31(-0.56716323646760f)}, {Q31(-0.72929675029275f), Q31(-0.98008272727324f)},
+{Q31( 0.75622801399036f), Q31( 0.20950329995549f)}, {Q31( 0.07069442601050f), Q31(-0.78247898470706f)},
+#endif
 };



More information about the ffmpeg-cvslog mailing list