From: Jingning Han Date: Tue, 30 Apr 2019 17:36:54 +0000 (-0700) Subject: Fix the use of uninitialized value in qsort X-Git-Tag: v1.8.1~75^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf30ae3ad654e3f21d2bdacd76f6bcc5d635e40c;p=libvpx Fix the use of uninitialized value in qsort Search within the effective transform coefficient window. Change-Id: If432eaab5ffca1cdfe57ee23052bf5dc60a2f893 --- diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 55cfd13c6..9ec273c21 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -4912,7 +4912,7 @@ static void set_mb_wiener_variance(VP9_COMP *cpi) { coeff[0] = 0; for (idx = 1; idx < coeff_count; ++idx) coeff[idx] = abs(coeff[idx]); - qsort(coeff, coeff_count, sizeof(*coeff), qsort_comp); + qsort(coeff, coeff_count - 1, sizeof(*coeff), qsort_comp); // Noise level estimation median_val = coeff[coeff_count / 2];