mirror of https://github.com/FreeRDP/FreeRDP
Fixed division by zero in urbdrc
This commit is contained in:
parent
0629bb9c20
commit
b54ca508ac
|
@ -1231,12 +1231,18 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, GENERIC_CHANNEL_CALLBACK*
|
|||
if (!Buffer)
|
||||
Stream_Seek(user_data->data, (NumberOfPackets * 12));
|
||||
|
||||
iso_packet_size = BufferSize / NumberOfPackets;
|
||||
iso_transfer = libusb_alloc_transfer((int)NumberOfPackets);
|
||||
if (NumberOfPackets > 0)
|
||||
{
|
||||
iso_packet_size = BufferSize / NumberOfPackets;
|
||||
iso_transfer = libusb_alloc_transfer((int)NumberOfPackets);
|
||||
}
|
||||
|
||||
if (iso_transfer == NULL)
|
||||
{
|
||||
WLog_Print(urbdrc->log, WLOG_ERROR, "Error: libusb_alloc_transfer.");
|
||||
WLog_Print(urbdrc->log, WLOG_ERROR,
|
||||
"Error: libusb_alloc_transfer [NumberOfPackets=%" PRIu32 ", BufferSize=%" PRIu32
|
||||
" ]",
|
||||
NumberOfPackets, BufferSize);
|
||||
async_transfer_user_data_free(user_data);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue