diff --git a/src/opus.c b/src/opus.c
index cdbd13a11cd78d470a98154fc1ea1e8a6c3dcef3..538b5ea74ebee7dfae2dc89e0bc9012a1e24ffec 100644
--- a/src/opus.c
+++ b/src/opus.c
@@ -252,7 +252,7 @@ int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
       /* Number of frames encoded in bits 0 to 5 */
       ch = *data++;
       count = ch&0x3F;
-      if (count <= 0 || framesize*count > 5760)
+      if (count <= 0 || framesize*(opus_int32)count > 5760)
          return OPUS_INVALID_PACKET;
       len--;
       /* Padding flag is bit 6 */