[FFmpeg-cvslog] avcodec/bonk: Actually clip when using av_clip()

Andreas Rheinhardt git at videolan.org
Tue Sep 13 00:53:11 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Sep 12 14:17:32 2022 +0200| [8d12f3de1401f10d93319ffdc46b01de9eba4285] | committer: Andreas Rheinhardt

avcodec/bonk: Actually clip when using av_clip()

Also fixes a "statement with no effect [-Wunused-value]"
warning from GCC.

Reviewed-by: James Almer <jamrial at gmail.com>
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/bonk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/bonk.c b/libavcodec/bonk.c
index f3d797d588..409694f710 100644
--- a/libavcodec/bonk.c
+++ b/libavcodec/bonk.c
@@ -280,7 +280,7 @@ static int predictor_calc_error(int *k, int *state, int order, int error)
     }
 
     // don't drift too far, to avoid overflows
-    av_clip(x, -(SAMPLE_FACTOR << 16), SAMPLE_FACTOR << 16);
+    x = av_clip(x, -(SAMPLE_FACTOR << 16), SAMPLE_FACTOR << 16);
 
     state[0] = x;
 



More information about the ffmpeg-cvslog mailing list