aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp9.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2015-05-15 21:14:08 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2015-05-15 21:14:08 -0400
commit68c1e9131654576fb3abc13da742c115303a3b54 (patch)
tree52c3ccde68b3006e19ead532b162ee261a920c17 /libavcodec/vp9.c
parent32b6d31ef3abd45186cfc69607ffe66837588d53 (diff)
downloadffmpeg-68c1e9131654576fb3abc13da742c115303a3b54.tar.gz
vp9: improve signbias check.
Otherwise it will still scale motion vectors, which leads to corrupted prediction.
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r--libavcodec/vp9.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 9540f3d812..42c1ec97e3 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -614,11 +614,11 @@ static int decode_frame_header(AVCodecContext *ctx,
} else {
s->refreshrefmask = get_bits(&s->gb, 8);
s->refidx[0] = get_bits(&s->gb, 3);
- s->signbias[0] = get_bits1(&s->gb);
+ s->signbias[0] = get_bits1(&s->gb) && !s->errorres;
s->refidx[1] = get_bits(&s->gb, 3);
- s->signbias[1] = get_bits1(&s->gb);
+ s->signbias[1] = get_bits1(&s->gb) && !s->errorres;
s->refidx[2] = get_bits(&s->gb, 3);
- s->signbias[2] = get_bits1(&s->gb);
+ s->signbias[2] = get_bits1(&s->gb) && !s->errorres;
if (!s->refs[s->refidx[0]].f->data[0] ||
!s->refs[s->refidx[1]].f->data[0] ||
!s->refs[s->refidx[2]].f->data[0]) {
@@ -648,8 +648,7 @@ static int decode_frame_header(AVCodecContext *ctx,
s->highprecisionmvs = get_bits1(&s->gb);
s->filtermode = get_bits1(&s->gb) ? FILTER_SWITCHABLE :
get_bits(&s->gb, 2);
- s->allowcompinter = !s->errorres &&
- (s->signbias[0] != s->signbias[1] ||
+ s->allowcompinter = (s->signbias[0] != s->signbias[1] ||
s->signbias[0] != s->signbias[2]);
if (s->allowcompinter) {
if (s->signbias[0] == s->signbias[1]) {