Commit ec994d8b authored by Tristan Matthews's avatar Tristan Matthews Committed by Yaowu Xu

accounting_test: fix read of uninitialized data

Only read bits that were actually written.

Change-Id: I6d901123c319a1d92c54f511d3caa56daf882281
parent 4891ef9a
......@@ -35,7 +35,7 @@ TEST(AV1, TestAccounting) {
}
aom_stop_encode(&bw);
aom_reader br;
aom_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
aom_reader_init(&br, bw_buffer, bw.pos, NULL, NULL);
Accounting accounting;
aom_accounting_init(&accounting);
......@@ -51,7 +51,7 @@ TEST(AV1, TestAccounting) {
GTEST_ASSERT_EQ(accounting.syms.num_syms, 0);
// Should record 2 * kSymbols accounting symbols.
aom_reader_init(&br, bw_buffer, kBufferSize, NULL, NULL);
aom_reader_init(&br, bw_buffer, bw.pos, NULL, NULL);
br.accounting = &accounting;
for (int i = 0; i < kSymbols; i++) {
aom_read(&br, 32, "A");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment