diff --git a/src/opus_decoder.c b/src/opus_decoder.c
index d71282c27847636b41b345ed7ef9a1b8bd4ad7ee..84b4465b3bec8419733e830d4f70a9c5797ab371 100644
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -296,7 +296,6 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
     if (mode != MODE_CELT_ONLY)
     	start_band = 17;
 
-    if (mode != MODE_SILK_ONLY)
     {
         int endband=21;
 
@@ -305,6 +304,7 @@ static int opus_decode_frame(OpusDecoder *st, const unsigned char *data,
         case OPUS_BANDWIDTH_NARROWBAND:
             endband = 13;
             break;
+        case OPUS_BANDWIDTH_MEDIUMBAND:
         case OPUS_BANDWIDTH_WIDEBAND:
             endband = 17;
             break;
diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index 3013c84eda7dba08e924cc581166a26a9aa5d1e5..076c053bd7ffa1f0c397244027f882e2966fccbd 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -438,6 +438,7 @@ int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
 	    case OPUS_BANDWIDTH_NARROWBAND:
 	    	endband = 13;
 	    	break;
+        case OPUS_BANDWIDTH_MEDIUMBAND:
 	    case OPUS_BANDWIDTH_WIDEBAND:
 	    	endband = 17;
 	    	break;