Commit 872fc3de authored by John Koleszar's avatar John Koleszar
Browse files

disambiguate superframe index in vp9_stop_encode()

If the bool-coded partition naturally ends in a byte that matches the
superframe index marker, it could lead to a parse error. This commit
ensures that if such a marker is seen, it is padded out with an
additional zero byte to disambiguate it.

Change-Id: Id977de05745b6fa9ef08afb71e210a2a3ecca02e
parent 49d1425d
......@@ -53,6 +53,10 @@ void vp9_stop_encode(BOOL_CODER *br) {
for (i = 0; i < 32; i++)
encode_bool(br, 0, 128);
// Ensure there's no ambigous collision with any index marker bytes
if ((br->buffer[br->pos - 1] & 0xe0) == 0xc0)
br->buffer[br->pos++] = 0;
Supports Markdown
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