diff options
author | James Zern <jzern@google.com> | 2016-01-28 12:53:41 -0800 |
---|---|---|
committer | James Zern <jzern@google.com> | 2016-01-28 12:53:41 -0800 |
commit | 4f780e94a1fa54f22256e0f4d42a77c340a38fa1 (patch) | |
tree | 8ff92561293c5fa9428e71fe6d28a3fbedaeb85e /vp8/encoder | |
parent | d1e3d0467c7efbc6eeddefc9d568cf928110e8fb (diff) | |
download | libvpx-4f780e94a1fa54f22256e0f4d42a77c340a38fa1.tar libvpx-4f780e94a1fa54f22256e0f4d42a77c340a38fa1.tar.gz libvpx-4f780e94a1fa54f22256e0f4d42a77c340a38fa1.tar.bz2 libvpx-4f780e94a1fa54f22256e0f4d42a77c340a38fa1.zip |
vp9/10: fix encoder crash on flush
the lookahead buffer allocation is deferred to receipt of the first
frame to allow profile changes. if the encoder was flushed before
supplying any frames the encoder would crash trying to dereference the
NULL buffer. vp8 is unaffected.
fixes mozilla bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1237848
Change-Id: Icee4b64de760476eee0d33b568f0a1010335ff13
Diffstat (limited to 'vp8/encoder')
-rw-r--r-- | vp8/encoder/lookahead.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vp8/encoder/lookahead.c b/vp8/encoder/lookahead.c index ce2ce08c1..662338574 100644 --- a/vp8/encoder/lookahead.c +++ b/vp8/encoder/lookahead.c @@ -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); |