Index: webrtc/base/bitbuffer.cc |
diff --git a/webrtc/base/bitbuffer.cc b/webrtc/base/bitbuffer.cc |
index cd3661343b290ae25aed1e34a04a7390643c5ead..bbd1047f901df16974e3d0322713f814a8cda0dc 100644 |
--- a/webrtc/base/bitbuffer.cc |
+++ b/webrtc/base/bitbuffer.cc |
@@ -187,6 +187,17 @@ bool BitBuffer::ReadExponentialGolomb(uint32_t* val) { |
return true; |
} |
+bool BitBuffer::ReadSignedExponentialGolomb(int32_t* val) { |
+ // TODO(pbos): Is there a corner case I'm missing here? |
+ uint32_t unsigned_val; |
+ if (!ReadExponentialGolomb(&unsigned_val)) |
noahric
2015/09/03 17:48:58
Brackets to match the rest of the file :-p
pbos-webrtc
2015/09/04 10:01:20
Done.
|
+ return false; |
+ if ((unsigned_val & 1) == 0) |
noahric
2015/09/03 17:48:58
This if just falls through and overwrites val, so
pbos-webrtc
2015/09/04 10:01:20
Done, which also uncovered additional bugs. That a
|
+ *val = (unsigned_val + 1) / 2; |
+ *val = -(unsigned_val / 2); |
+ return true; |
+} |
+ |
void BitBuffer::GetCurrentOffset( |
size_t* out_byte_offset, size_t* out_bit_offset) { |
CHECK(out_byte_offset != NULL); |