summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2013-03-12 14:30:18 -0700
committerJohn Koleszar <jkoleszar@google.com>2013-03-12 14:30:23 -0700
commit872fc3ded88da483e723d5aa0a19993dff191fc7 (patch)
treeb49b9c6b70c081cdea5b1c7d3b8819f25286ac89 /vp9/encoder
parent49d1425d1949bfee12cb07bd18ed4c32e910541b (diff)
downloadlibvpx-872fc3ded88da483e723d5aa0a19993dff191fc7.tar
libvpx-872fc3ded88da483e723d5aa0a19993dff191fc7.tar.gz
libvpx-872fc3ded88da483e723d5aa0a19993dff191fc7.tar.bz2
libvpx-872fc3ded88da483e723d5aa0a19993dff191fc7.zip
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
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_boolhuff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_boolhuff.c b/vp9/encoder/vp9_boolhuff.c
index a590902c2..213742182 100644
--- a/vp9/encoder/vp9_boolhuff.c
+++ b/vp9/encoder/vp9_boolhuff.c
@@ -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;
}