From 5e2d6ea0292392164d3023506e55eaa6347773df Mon Sep 17 00:00:00 2001 From: David Fort Date: Fri, 22 Dec 2017 17:55:48 +0100 Subject: [PATCH] zgfx: add a check --- libfreerdp/codec/zgfx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libfreerdp/codec/zgfx.c b/libfreerdp/codec/zgfx.c index 087655b1c..08f055cf7 100644 --- a/libfreerdp/codec/zgfx.c +++ b/libfreerdp/codec/zgfx.c @@ -317,7 +317,10 @@ int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, BY { int status = -1; BYTE descriptor; + wStream* stream = Stream_New((BYTE*)pSrcData, SrcSize); + if (!stream) + return -1; if (Stream_GetRemainingLength(stream) < 1) goto fail;