This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: dvb-dev-remote: improve the data receive logic
Author:  Mauro Carvalho Chehab <mche...@s-opensource.com>
Date:    Fri Sep 16 04:21:36 2016 -0300

Be pedantic if it receives less data than expected: this is a
fatal error, as all subsequent data receive will not be decoded
properly.

Signed-off-by: Mauro Carvalho Chehab <mche...@s-opensource.com>

 lib/libdvbv5/dvb-dev-remote.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=7bf4d4034c83316aac77abec16a220385781abfd
diff --git a/lib/libdvbv5/dvb-dev-remote.c b/lib/libdvbv5/dvb-dev-remote.c
index 231e587b5106..44c9e1d4a986 100644
--- a/lib/libdvbv5/dvb-dev-remote.c
+++ b/lib/libdvbv5/dvb-dev-remote.c
@@ -623,7 +623,7 @@ static void *receive_data(void *privdata)
 
        do {
                size = recv(priv->fd, buf, 4, MSG_WAITALL);
-               if (size <= 0) {
+               if (size < 4) {
                        if (size < 0)
                                dvb_perror("recv");
                        else
@@ -632,8 +632,8 @@ static void *receive_data(void *privdata)
                        return NULL;
                }
                size = be32toh(*(int32_t *)buf);
-               size = recv(priv->fd, buf, size, MSG_WAITALL);
-               if (size <= 0) {
+               ret = recv(priv->fd, buf, size, MSG_WAITALL);
+               if (ret != size) {
                        if (size < 0)
                                dvb_perror("recv");
                        else

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to