fix superframe index marker masks
The superframe index marker byte carries data in the lower 5 bits. Only the
upper 3 should be used as part of the mask to detect it. By masking with
0xf0, the previous code was incorrect for frames over 65k bytes.
Change-Id: I6248889f5af227457f359a56b2348ef6db87a3b4
diff --git a/test/superframe_test.cc b/test/superframe_test.cc
index 39190ea..52faddb 100644
--- a/test/superframe_test.cc
+++ b/test/superframe_test.cc
@@ -54,7 +54,7 @@
const int frames = (marker & 0x7) + 1;
const int mag = ((marker >> 3) & 3) + 1;
const unsigned int index_sz = 2 + mag * frames;
- if ((marker & 0xf0) == 0xc0 &&
+ if ((marker & 0xe0) == 0xc0 &&
pkt->data.frame.sz >= index_sz &&
buffer[pkt->data.frame.sz - index_sz] == marker) {
// frame is a superframe. strip off the index.
diff --git a/vp9/vp9_dx_iface.c b/vp9/vp9_dx_iface.c
index 1bda170..eabdb85 100644
--- a/vp9/vp9_dx_iface.c
+++ b/vp9/vp9_dx_iface.c
@@ -435,7 +435,7 @@
marker = data[data_sz - 1];
*count = 0;
- if ((marker & 0xf0) == 0xc0) {
+ if ((marker & 0xe0) == 0xc0) {
const int frames = (marker & 0x7) + 1;
const int mag = ((marker >> 3) & 3) + 1;
const int index_sz = 2 + mag * frames;
@@ -473,7 +473,7 @@
do {
// Skip over the superframe index, if present
- if (data_sz && (*data_start & 0xf0) == 0xc0) {
+ if (data_sz && (*data_start & 0xe0) == 0xc0) {
const uint8_t marker = *data_start;
const int frames = (marker & 0x7) + 1;
const int mag = ((marker >> 3) & 3) + 1;