Fix issue 4061.
Issue was that the longest 0 detection wasn't done when there is only one 0 octet. The purpose of this detection is to make sure we don't also compression 0 octet sequences which are not longest.
BUG=4061
R=juberti@webrtc.org, pthatcher@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/33309004
Cr-Commit-Position: refs/heads/master@{#8397}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8397 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/base/win32.cc b/webrtc/base/win32.cc
index 8f56612..c1b55bf 100644
--- a/webrtc/base/win32.cc
+++ b/webrtc/base/win32.cc
@@ -86,7 +86,7 @@
reinterpret_cast<const uint16*>(src);
int runpos[8];
int current = 1;
- int max = 1;
+ int max = 0;
int maxpos = -1;
int run_array_size = ARRAY_SIZE(runpos);
// Run over the address marking runs of 0s.
@@ -100,11 +100,11 @@
++current;
} else {
runpos[i] = -1;
- current =1;
+ current = 1;
}
}
- if (max > 1) {
+ if (max > 0) {
int tmpmax = maxpos;
// Run back through, setting -1 for all but the longest run.
for (int i = run_array_size - 1; i >= 0; i--) {