Commit b67d81a8 authored by Andrea Zoli's avatar Andrea Zoli
Browse files

Fix throw on ByteStream::GetValue().

parent 75ffbb73
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@


#include "ByteStream.h"
#include "ByteStream.h"
#include "PacketLibDemo.h"
#include "PacketLibDemo.h"
#include "PacketException.h"
#include "Utility.h"
#include "Utility.h"
#include "lz4.h"
#include "lz4.h"
#include "lz4hc.h"
#include "lz4hc.h"
@@ -228,7 +229,7 @@ long PacketLib::ByteStream::getValue(dword start, word dim)
    byte b1, b2;
    byte b1, b2;
	
	
	if(start >= byteInTheStream)
	if(start >= byteInTheStream)
		throw new PacketException("PacketLib::ByteStream::getValue() start greater than the size of the ByteStream");
		throw PacketException("PacketLib::ByteStream::getValue() start greater than the size of the ByteStream", 0);
	
	
    /// only 1 or 2 bytes
    /// only 1 or 2 bytes
    if(dim == 0 || dim > 2)
    if(dim == 0 || dim > 2)