Commit 310e290c authored by Andrea Zoli's avatar Andrea Zoli
Browse files

Fix bad jump that depends on uninitialised value(s) of mem_allocation_constructor.

parent fe6307cd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -78,6 +78,8 @@ PacketLib::ByteStream::ByteStream(byte* stream, dword dim, bool bigendian, bool

PacketLib::ByteStream::ByteStream(ByteStream* b0, ByteStream* b1, ByteStream* b2)
{
    mem_allocation_constructor = true;

    /// Streams are swapped
    dword i = 0;
    dword dim = 0;
@@ -88,6 +90,7 @@ PacketLib::ByteStream::ByteStream(ByteStream* b0, ByteStream* b1, ByteStream* b2

        byteInTheStream  = 0;
        stream = 0;
        mem_allocation_constructor = false;
        return;
    }
    byteInTheStream = (b0!=0?b0->getDimension():0) + (b1!=0?b1->getDimension():0) + (b2!=0?b2->getDimension():0);
@@ -120,6 +123,7 @@ PacketLib::ByteStream::ByteStream(ByteStream* b0, ByteStream* b1, ByteStream* b2
        }
    }
    setMemoryAllocated(true);
    mem_allocation_constructor = false;
}