Bug 1237848 - Check lookahead ctx - r=rillian

Copied from https://chromium-review.googlesource.com/324510
This commit is contained in:
Gerald Squelart 2016-02-04 11:29:00 +11:00
parent 9fed28582d
commit 422f564ea3
2 changed files with 2 additions and 1 deletions

View File

@ -181,6 +181,7 @@ vp8_lookahead_pop(struct lookahead_ctx *ctx,
{
struct lookahead_entry* buf = NULL;
assert(ctx != NULL);
if(ctx->sz && (drain || ctx->sz == ctx->max_sz - 1))
{
buf = pop(ctx, &ctx->read_idx);

View File

@ -207,7 +207,7 @@ struct lookahead_entry *vp9_lookahead_pop(struct lookahead_ctx *ctx,
int drain) {
struct lookahead_entry *buf = NULL;
if (ctx->sz && (drain || ctx->sz == ctx->max_sz - MAX_PRE_FRAMES)) {
if (ctx && ctx->sz && (drain || ctx->sz == ctx->max_sz - MAX_PRE_FRAMES)) {
buf = pop(ctx, &ctx->read_idx);
ctx->sz--;
}