Commit f18328cb authored by Deb Mukherjee's avatar Deb Mukherjee
Browse files

Adds a zero check in model_rd function

Avoids divide-by-zero when variance is 0.

Change-Id: I3c7f526979046ff7d17714ce960fe81d6e1442a0
parent 9b78ed82
......@@ -1803,7 +1803,10 @@ static void model_rd_from_var_lapndz(int var, int n, int qstep,
// TODO(debargha): Implement the functions by interpolating from a
// look-up table
vp9_clear_system_state();
{
if (var == 0 || n == 0) {
*rate = 0;
*dist = 0;
} else {
double D, R;
double s2 = (double) var / n;
double s = sqrt(s2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment