ffmpeg | branch: master | Rostislav Pehlivanov <atomnu...@gmail.com> | Fri Feb 24 19:13:44 2017 +0000| [70259737cbad1136d942fa0cca5d55be1ca37e0a] | committer: Rostislav Pehlivanov
opus_pvq: prevent division by 0 res was 0 and divided K which made it infinity which caused K to overflow. Signed-off-by: Rostislav Pehlivanov <atomnu...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=70259737cbad1136d942fa0cca5d55be1ca37e0a --- libavcodec/opus_pvq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/opus_pvq.c b/libavcodec/opus_pvq.c index 706e239..ce93c47 100644 --- 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]); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog