OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e01c32f
)
opus_pvq: prevent division by 0
author
Rostislav Pehlivanov
<atomnuker@gmail.com>
Fri, 24 Feb 2017 19:13:44 +0000
(19:13 +0000)
committer
Rostislav Pehlivanov
<atomnuker@gmail.com>
Fri, 24 Feb 2017 19:14:55 +0000
(19:14 +0000)
res was 0 and divided K which made it infinity which caused K to
overflow.
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavcodec/opus_pvq.c
patch
|
blob
|
history
diff --git
a/libavcodec/opus_pvq.c
b/libavcodec/opus_pvq.c
index
706e239
..
ce93c47
100644
(file)
--- a/
libavcodec/opus_pvq.c
+++ b/
libavcodec/opus_pvq.c
@@
-397,7
+397,7
@@
static void celt_pvq_search(float *X, int *y, int K, int N)
for (i = 0; i < N; i++)
res += FFABS(X[i]);
- res = K/
res
;
+ res = K/
(res + FLT_EPSILON)
;
for (i = 0; i < N; i++) {
y[i] = lrintf(res*X[i]);