shithub: opus

Download patch

ref: 5170dbf3eeff96b105062bf5ef14199afb148f8b
parent: 883bd8e55646d07ddd20e1f14a4a0aad6c324b0f
author: Gregory Maxwell <[email protected]>
date: Thu Feb 14 11:02:25 EST 2008

Fix handling of truncated ogg packets.

--- a/tools/celtdec.c
+++ b/tools/celtdec.c
@@ -527,7 +527,7 @@
          last_granule = page_granule;
          /*Extract all available packets*/
          packet_no=0;
-         while (!eos && ogg_stream_packetout(&os, &op) == 1)
+         while (!eos && ogg_stream_packetout(&os, &op) == 1 && op.bytes>=8)
          {
 	    if (!memcmp(op.packet, "CELT    ", 8)) {
 	       celt_serialno = os.serialno;