From 890eee3b47f6a54a6c2f571f04ff8eae337e922a Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Thu, 29 Aug 2013 15:33:06 -0700 Subject: [PATCH] Fixing problem with invalid delta_q reading. This is a bitstream change but no currently produces videos should be affected. https://code.google.com/p/webm/issues/detail?id=610 Change-Id: Ic85a6477df6c201cdf7f70f6bd84607b71f4593c --- test/test-data.sha1 | 2 ++ test/test.mk | 2 ++ test/test_vector_test.cc | 2 +- vp9/decoder/vp9_decodframe.c | 3 +-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test-data.sha1 b/test/test-data.sha1 index 579d7e254..370ffc13c 100644 --- a/test/test-data.sha1 +++ b/test/test-data.sha1 @@ -522,3 +522,5 @@ fe0af2ee47b1e5f6a66db369e2d7e9d870b38dce vp90-2-03-size-226x226.webm 94ad19b8b699cea105e2ff18f0df2afd7242bcf7 vp90-2-03-size-226x226.webm.md5 495256cfd123fe777b2c0406862ed8468a1f4677 vp91-2-04-yv444.webm 65e3a7ffef61ab340d9140f335ecc49125970c2c vp91-2-04-yv444.webm.md5 +b6524e4084d15b5d0caaa3d3d1368db30cbee69c vp90-2-03-deltaq.webm +65f45ec9a55537aac76104818278e0978f94a678 vp90-2-03-deltaq.webm.md5 diff --git a/test/test.mk b/test/test.mk index 2042c86d9..4eb599dd8 100644 --- a/test/test.mk +++ b/test/test.mk @@ -629,5 +629,7 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm.md5 LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm.md5 +LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm +LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm.md5 LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm.md5 diff --git a/test/test_vector_test.cc b/test/test_vector_test.cc index 4cd356d81..9bd03b997 100644 --- a/test/test_vector_test.cc +++ b/test/test_vector_test.cc @@ -159,7 +159,7 @@ const char *kVP9TestVectors[] = { "vp90-2-03-size-226x198.webm", "vp90-2-03-size-226x200.webm", "vp90-2-03-size-226x202.webm", "vp90-2-03-size-226x208.webm", "vp90-2-03-size-226x210.webm", "vp90-2-03-size-226x224.webm", - "vp90-2-03-size-226x226.webm", + "vp90-2-03-size-226x226.webm", "vp90-2-03-deltaq.webm", #if CONFIG_NON420 "vp91-2-04-yv444.webm" #endif diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index e41ea541d..6cb7c094b 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -454,8 +454,7 @@ static void setup_loopfilter(struct loopfilter *lf, static int read_delta_q(struct vp9_read_bit_buffer *rb, int *delta_q) { const int old = *delta_q; - if (vp9_rb_read_bit(rb)) - *delta_q = vp9_rb_read_signed_literal(rb, 4); + *delta_q = vp9_rb_read_bit(rb) ? vp9_rb_read_signed_literal(rb, 4) : 0; return old != *delta_q; }