Skip to content

Commit ed218c6

Browse files
author
kazuho
committed
fix overrun
git-svn-id: http://svn.coderepos.org/share/lang/cplusplus/range_coder@7158 d0d07461-0603-4401-acd4-de1884942a52
1 parent 16d09fd commit ed218c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

range_coder.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ template<int _BASE> struct rc_decoder_search_t<short, 256, _BASE> : public rc_de
123123
__m128i b = _mm_cmplt_epi16(v, y);
124124
mask = (_mm_movemask_epi8(b) << 16) | _mm_movemask_epi8(a);
125125
if (mask) {
126-
break;
126+
return i + (__builtin_ctz(mask) >> 1) - 1;
127127
}
128128
}
129-
return i + (__builtin_ctz(mask) >> 1) - 1;
129+
return 255;
130130
}
131131
};
132132

0 commit comments

Comments
 (0)