diff --git a/src/cwc.c b/src/cwc.c index 6b38f212..431596a4 100644 --- a/src/cwc.c +++ b/src/cwc.c @@ -469,7 +469,7 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq) buf[4] = sid >> 8; buf[5] = sid; - if((len = des_encrypt(buf, len, cwc)) < 0) { + if((len = des_encrypt(buf, len, cwc)) <= 0) { free(buf); free(cm); return -1; diff --git a/src/rawtsinput.c b/src/rawtsinput.c index b1db456f..24a71d34 100644 --- a/src/rawtsinput.c +++ b/src/rawtsinput.c @@ -184,7 +184,7 @@ got_pat(const uint8_t *ptr, size_t len, void *opaque) len -= 8; ptr += 8; - if(len < 0) + if(len <= 0) return; pthread_mutex_lock(&global_lock); diff --git a/src/tsdemux.c b/src/tsdemux.c index 897fe1d6..57d6836e 100644 --- a/src/tsdemux.c +++ b/src/tsdemux.c @@ -142,8 +142,6 @@ ts_extract_pcr(service_t *t, elementary_stream_t *st, const uint8_t *tsb, pcr |= (uint64_t)tsb[9] << 1; pcr |= ((uint64_t)tsb[10] >> 7) & 0x01; - pcr = pcr; - if(pcrp != NULL) *pcrp = pcr; diff --git a/src/tvheadend.h b/src/tvheadend.h index c4c1d777..85f8395f 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -400,7 +400,7 @@ extern void scopedunlock(pthread_mutex_t **mtxp); #define scopedlock(mtx) \ pthread_mutex_t *scopedlock ## __LINE__ \ __attribute__((cleanup(scopedunlock))) = mtx; \ - pthread_mutex_lock(mtx); + pthread_mutex_lock(scopedlock ## __LINE__); #define scopedgloballock() scopedlock(&global_lock)