Skip to content

Commit c1033c9

Browse files
committed
Fix buffer underflow bug that crashes the app in Samsung S8 running Android 8
1 parent 9b04161 commit c1033c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/src/main/java/info/martinmarinov/drivers/usb/cxusb/CxUsbDvbDevice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private void dvb_usb_generic_rw(@NonNull byte[] wbuf, int wlen, @Nullable byte[]
174174

175175
// put delay here if needed
176176

177-
if (rbuf != null) {
177+
if (rbuf != null && rlen >= 0) {
178178
actlen = usbDeviceConnection.bulkTransfer(controlEndpointIn, rbuf, rlen, 5_000);
179179
if (actlen < rlen) {
180180
if (actlen >= 0) actlen = -1;

0 commit comments

Comments
 (0)