diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index b13ac92f6a68634241e2893ffbb658b427ea4f8e..76b0702470149356e249623c236d4791d7ce9d68 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -321,7 +321,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
     }
 
     start_band = 0;
-    if (!decode_fec && mode != MODE_CELT_ONLY && data != NULL && ec_tell(&dec)+17+20*(st->mode == MODE_HYBRID) < 8*len)
+    if (!decode_fec && mode != MODE_CELT_ONLY && data != NULL && ec_tell(&dec)+17+20*(st->mode == MODE_HYBRID) <= 8*len)
     {
         /* Check if we have a redundant 0-8 kHz band */
         if (mode == MODE_HYBRID)
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 3faca4e48111718f2c1cc927de36cf61c68f9194..4b55d23233aa3389b96d1d5104eb12b018028f87 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -918,7 +918,7 @@ int opus_encode_float(OpusEncoder *st, const opus_val16 *pcm, int frame_size,
         }
     }
 
-    if ( st->mode != MODE_CELT_ONLY && ec_tell(&enc)+17+20*(st->mode == MODE_HYBRID) < 8*(max_data_bytes-1))
+    if ( st->mode != MODE_CELT_ONLY && ec_tell(&enc)+17+20*(st->mode == MODE_HYBRID) <= 8*(max_data_bytes-1))
     {
         /* For SILK mode, the redundancy is inferred from the length */
         if (st->mode == MODE_HYBRID && (redundancy || ec_tell(&enc)+37 < 8*nb_compr_bytes))