Browse Source

vp9: disable use_last_frame_mvs on resolution change (scalable).

Prevents some invalid memory accesses after resolution change in
vp90-2-05-resize.webm, and libvpx does this too.

Reviewed-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Ronald S. Bultje Michael Niedermayer 11 years ago
parent
commit
d9343c3484
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/vp9.c

+ 2
- 1
libavcodec/vp9.c View File

@@ -467,7 +467,6 @@ static int decode_frame_header(AVCodecContext *ctx,
last_invisible = s->invisible; last_invisible = s->invisible;
s->invisible = !get_bits1(&s->gb); s->invisible = !get_bits1(&s->gb);
s->errorres = get_bits1(&s->gb); s->errorres = get_bits1(&s->gb);
// FIXME disable this upon resolution change
s->use_last_frame_mvs = !s->errorres && !last_invisible; s->use_last_frame_mvs = !s->errorres && !last_invisible;
if (s->keyframe) { if (s->keyframe) {
if (get_bits_long(&s->gb, 24) != VP9_SYNCCODE) { // synccode if (get_bits_long(&s->gb, 24) != VP9_SYNCCODE) { // synccode
@@ -526,6 +525,8 @@ static int decode_frame_header(AVCodecContext *ctx,
w = get_bits(&s->gb, 16) + 1; w = get_bits(&s->gb, 16) + 1;
h = get_bits(&s->gb, 16) + 1; h = get_bits(&s->gb, 16) + 1;
} }
s->use_last_frame_mvs &= s->frames[LAST_FRAME].tf.f->width == w &&
s->frames[LAST_FRAME].tf.f->height == h;
if (get_bits1(&s->gb)) // display size if (get_bits1(&s->gb)) // display size
skip_bits(&s->gb, 32); skip_bits(&s->gb, 32);
s->highprecisionmvs = get_bits1(&s->gb); s->highprecisionmvs = get_bits1(&s->gb);


Loading…
Cancel
Save