diff mbox series

[FFmpeg-devel,165/191] avcodec/sinewin_tablegen: Use better check in assert

Message ID 20201123193739.1249300-3-andreas.rheinhardt@gmail.com
State Accepted
Commit 7688f94e90ee254382ee9c8cde81eed6408cf0f2
Headers show
Series VLC, esp. init_vlc patches | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 23, 2020, 7:37 p.m. UTC
There are no ff_sine_windows for 2^i, 0 <= i < 5, so one should check
for the index being >= 5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/sinewin_tablegen.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h
index dc52234ed0..3c11cb6282 100644
--- a/libavcodec/sinewin_tablegen.h
+++ b/libavcodec/sinewin_tablegen.h
@@ -74,7 +74,7 @@  av_cold void AAC_RENAME(ff_sine_window_init)(INTFLOAT *window, int n) {
 }
 
 av_cold void AAC_RENAME(ff_init_ff_sine_windows)(int index) {
-    assert(index >= 0 && index < FF_ARRAY_ELEMS(AAC_RENAME(ff_sine_windows)));
+    assert(index >= 5 && index < FF_ARRAY_ELEMS(AAC_RENAME(ff_sine_windows)));
 #if !CONFIG_HARDCODED_TABLES
     AAC_RENAME(ff_sine_window_init)(AAC_RENAME(ff_sine_windows)[index], 1 << index);
 #endif