mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Added return checks.
This commit is contained in:
@@ -508,7 +508,10 @@ static UINT rdpgfx_write_h264_metablock(wStream* s, RDPGFX_H264_METABLOCK* meta)
|
||||
RECTANGLE_16* regionRect;
|
||||
RDPGFX_H264_QUANT_QUALITY* quantQualityVal;
|
||||
UINT error = CHANNEL_RC_OK;
|
||||
Stream_EnsureRemainingCapacity(s, 4 + meta->numRegionRects * 10);
|
||||
|
||||
if (!Stream_EnsureRemainingCapacity(s, 4 + meta->numRegionRects * 10))
|
||||
return ERROR_OUTOFMEMORY;
|
||||
|
||||
Stream_Write_UINT32(s, meta->numRegionRects); /* numRegionRects (4 bytes) */
|
||||
|
||||
for (index = 0; index < meta->numRegionRects; index++)
|
||||
@@ -553,7 +556,9 @@ static INLINE UINT rdpgfx_write_h264_avc420(wStream* s,
|
||||
return error;
|
||||
}
|
||||
|
||||
Stream_EnsureRemainingCapacity(s, havc420->length);
|
||||
if (!Stream_EnsureRemainingCapacity(s, havc420->length))
|
||||
return ERROR_OUTOFMEMORY;
|
||||
|
||||
Stream_Write(s, havc420->data, havc420->length);
|
||||
return error;
|
||||
}
|
||||
@@ -1273,28 +1278,28 @@ static UINT rdpgfx_server_receive_pdu(RdpgfxServerContext* context, wStream* s)
|
||||
case RDPGFX_CMDID_FRAMEACKNOWLEDGE:
|
||||
if ((error = rdpgfx_recv_frame_acknowledge_pdu(context, s)))
|
||||
WLog_ERR(TAG, "rdpgfx_recv_frame_acknowledge_pdu "
|
||||
"failed with error %"PRIu32"!", error);
|
||||
"failed with error %"PRIu32"!", error);
|
||||
|
||||
break;
|
||||
|
||||
case RDPGFX_CMDID_CACHEIMPORTOFFER:
|
||||
if ((error = rdpgfx_recv_cache_import_offer_pdu(context, s)))
|
||||
WLog_ERR(TAG, "rdpgfx_recv_cache_import_offer_pdu "
|
||||
"failed with error %"PRIu32"!", error);
|
||||
"failed with error %"PRIu32"!", error);
|
||||
|
||||
break;
|
||||
|
||||
case RDPGFX_CMDID_CAPSADVERTISE:
|
||||
if ((error = rdpgfx_recv_caps_advertise_pdu(context, s)))
|
||||
WLog_ERR(TAG, "rdpgfx_recv_caps_advertise_pdu "
|
||||
"failed with error %"PRIu32"!", error);
|
||||
"failed with error %"PRIu32"!", error);
|
||||
|
||||
break;
|
||||
|
||||
case RDPGFX_CMDID_QOEFRAMEACKNOWLEDGE:
|
||||
if ((error = rdpgfx_recv_qoe_frame_acknowledge_pdu(context, s)))
|
||||
WLog_ERR(TAG, "rdpgfx_recv_qoe_frame_acknowledge_pdu "
|
||||
"failed with error %"PRIu32"!", error);
|
||||
"failed with error %"PRIu32"!", error);
|
||||
|
||||
break;
|
||||
|
||||
@@ -1653,7 +1658,7 @@ UINT rdpgfx_server_handle_messages(RdpgfxServerContext* context)
|
||||
if ((ret = rdpgfx_server_receive_pdu(context, s)))
|
||||
{
|
||||
WLog_ERR(TAG, "rdpgfx_server_receive_pdu "
|
||||
"failed with error %"PRIu32"!", ret);
|
||||
"failed with error %"PRIu32"!", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user