[FFmpeg-cvslog] avfilter/vf_deshake_opencl: Ensure that the first iteration initializes the best variables

Michael Niedermayer git at videolan.org
Wed Jul 24 17:50:28 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Fri Jun 14 01:50:15 2024 +0200| [75de958c0f0a28d4b3164dd96f813cc2044aef89] | committer: Michael Niedermayer

avfilter/vf_deshake_opencl: Ensure that the first iteration initializes the best variables

Fixes: CID1452759 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9385847af47211e8c618198499ffea99614bb55d)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavfilter/vf_deshake_opencl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_deshake_opencl.c b/libavfilter/vf_deshake_opencl.c
index 4f1bb09362..6a46fff9e2 100644
--- a/libavfilter/vf_deshake_opencl.c
+++ b/libavfilter/vf_deshake_opencl.c
@@ -712,7 +712,7 @@ static int minimize_error(
             total_err += deshake_ctx->ransac_err[j];
         }
 
-        if (total_err < best_err) {
+        if (i == 0 || total_err < best_err) {
             for (int mi = 0; mi < 6; ++mi) {
                 best_model[mi] = model[mi];
             }



More information about the ffmpeg-cvslog mailing list