summaryrefslogtreecommitdiffstats
path: root/libfreerdp/codec/nsc.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:11 +0000
commit941f9937e0744d18de4cc0afa71e0caa925d82ac (patch)
tree67872b86dbf72d73e91188bf8de12594668fe4aa /libfreerdp/codec/nsc.c
parentAdding upstream version 3.3.0+dfsg1. (diff)
downloadfreerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.tar.xz
freerdp3-941f9937e0744d18de4cc0afa71e0caa925d82ac.zip
Adding upstream version 3.5.0+dfsg1.upstream/3.5.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libfreerdp/codec/nsc.c')
-rw-r--r--libfreerdp/codec/nsc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libfreerdp/codec/nsc.c b/libfreerdp/codec/nsc.c
index 049b541..74f4e28 100644
--- a/libfreerdp/codec/nsc.c
+++ b/libfreerdp/codec/nsc.c
@@ -160,7 +160,7 @@ static BOOL nsc_rle_decode(const BYTE* in, size_t inSize, BYTE* out, UINT32 outS
len |= ((UINT32)(*in++)) << 24U;
}
- if (outSize < len)
+ if ((outSize < len) || (left < len))
return FALSE;
outSize -= len;
@@ -262,7 +262,7 @@ static BOOL nsc_context_initialize(NSC_CONTEXT* context, wStream* s)
if (!nsc_stream_initialize(context, s))
return FALSE;
- const size_t blength = context->width * context->height * 4ull;
+ const size_t blength = 4ull * context->width * context->height;
if (!context->BitmapData || (blength > context->BitmapDataLength))
{