Diff between 9745efcc75d2b56c22824a2d877c92cdda33dafe and 4b21e1aa7621206ed7a4a83ad8f375c848bb72fa

Changed Files

File Additions Deletions Status
android/client/if-sco.c +5 -1 modified

Full Patch

diff --git a/android/client/if-sco.c b/android/client/if-sco.c
index 70e2737..c33b012 100644
--- a/android/client/if-sco.c
+++ b/android/client/if-sco.c
@@ -287,7 +287,7 @@ static void *read_thread(void *data)
 {
 	int (*filbuff_cb) (short*, void*) = feed_from_in;
 	short buffer[buffer_size_in / sizeof(short)];
-	size_t len = 0;
+	ssize_t len = 0;
 	void *cb_data = NULL;
 	FILE *out = data;
 
@@ -311,6 +311,10 @@ static void *read_thread(void *data)
 		pthread_mutex_unlock(&state_mutex);
 
 		len = filbuff_cb(buffer, cb_data);
+		if (len < 0) {
+			haltest_error("Error receiving SCO data");
+			break;
+		}
 
 		haltest_info("Read %zd bytes\n", len);