opus_pvq: fix crashing on analysis of mono

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
pull/272/head
Rostislav Pehlivanov 7 years ago
parent 79a26ef802
commit 6e0723470b
  1. 3
      libavcodec/opus_pvq.c

@ -925,7 +925,8 @@ static float pvq_band_cost(CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, int b
for (i = 0; i < band_size; i++) { for (i = 0; i < band_size; i++) {
err_x += (X[i] - X_orig[i])*(X[i] - X_orig[i]); err_x += (X[i] - X_orig[i])*(X[i] - X_orig[i]);
err_y += (Y[i] - Y_orig[i])*(Y[i] - Y_orig[i]); if (Y)
err_y += (Y[i] - Y_orig[i])*(Y[i] - Y_orig[i]);
} }
dist = sqrtf(err_x) + sqrtf(err_y); dist = sqrtf(err_x) + sqrtf(err_y);

Loading…
Cancel
Save