Merge "Convert to int before adding negative numbers" into nextgenv2

This commit is contained in:
Yaowu Xu
2016-09-09 22:39:32 +00:00
committed by Gerrit Code Review

View File

@@ -213,8 +213,8 @@ struct lookahead_entry *av1_lookahead_peek(struct lookahead_ctx *ctx,
} else if (index < 0) {
// Backward peek
if (-index <= MAX_PRE_FRAMES) {
index += ctx->read_idx;
if (index < 0) index += ctx->max_sz;
index += (int)(ctx->read_idx);
if (index < 0) index += (int)(ctx->max_sz);
buf = ctx->buf + index;
}
}