Closed Muzza closed 9 years ago
Thanks for reporting this Muzza. I'll dig up a copy of VS2013 and repro this. (Might merge in your change right now too.)
I've pushed your fix.
I'm downloading VS 2013 Express Windows Desktop edition, hopefully that will let me test the codec without having to make an order from the MS company store.
I'm using the free visual studio 2013 community edition: http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx
I've built with 2013 and I'm testing the x64 release version on around ~49,000. I'll test x86 and debug as well.
I've been testing with VS 2013 all day - so far so good. I'm going to keep testing with VS 2013 and 2010 going forward from now on.
VS2010 runs fine, but VS2013 asserts during generate_codes.
The reason seems to be that in
total_bits(uint v)
the call to_BitScanReverse
behaves differently in Visual Studio 2013 to Visual Studio 2010. When the variable v is zero,_BitScanReverse(&l, v)
will setl
to0xcccccccc
and return zero. In VS2010l
does not get changed and so is still zero.As a workaround fix I changed:
if (_BitScanReverse(&l, v)) { l++; }
to:
if (_BitScanReverse(&l, v)) { l++; } else { l = 0; }
This gets past this error, although I've yet to fully test the rest of the lib so I don't know if there are any other issues.