summaryrefslogtreecommitdiff
path: root/libavcodec/vp9.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2014-01-25 20:11:28 -0500
committerMichael Niedermayer <michaelni@gmx.at>2014-01-26 20:15:45 +0100
commitd9343c348412d9b790c6da6b64c07ef85aefd145 (patch)
tree0918834e6c2ef4ae5e80b1e194c4a72dd53f6c96 /libavcodec/vp9.c
parente6c0da70fc82d7af4e730c901e8e0ccd87b37060 (diff)
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>
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r--libavcodec/vp9.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 29653949d5..e85a099b64 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -467,7 +467,6 @@ static int decode_frame_header(AVCodecContext *ctx,
last_invisible = s->invisible;
s->invisible = !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;
if (s->keyframe) {
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;
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
skip_bits(&s->gb, 32);
s->highprecisionmvs = get_bits1(&s->gb);