Don't misdecode 1 byte repeat counts 0xFE and 0xFF

This commit is contained in:
Ilari Liusvaara 2011-11-10 00:54:28 +02:00
parent 63fbeeed5a
commit 88e27dee03

View file

@ -225,7 +225,7 @@ uint64_t rrdata::read(std::vector<char>& strm, bool dummy) throw(std::bad_alloc)
ptr += lengthbytes;
}
if(lengthbytes == 1)
repeat = 2 + buf2[0];
repeat = 2 + static_cast<unsigned>(buf2[0]);
if(lengthbytes == 2)
repeat = 258 + static_cast<unsigned>(buf2[0]) * 256 + buf2[1];
if(lengthbytes == 3)