Skip to content

Commit

Permalink
openh264 check for room in compressed buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed Nov 12, 2024
1 parent ce7a187 commit c426da4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xrdp/xrdp_encoder_openh264.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ xrdp_encoder_openh264_encode(void *handle, int session, int left, int top,
write_location = cdata + lcdata_bytes;
payload = layer->pBsBuf + layer_position;
size = layer->pNalLengthInByte[jndex];
if (lcdata_bytes + size > *cdata_bytes)
{
LOG(LOG_LEVEL_INFO, "out of room");
return 5;
}
g_memcpy(write_location, payload, size);
layer_position += size;
lcdata_bytes += size;
Expand Down

0 comments on commit c426da4

Please sign in to comment.