shithub: opus-tools

Download patch

ref: 299575ef6110ab8bd1fa08ce3043a81c87e9d724
parent: c33d5bbfd537c21541422ee544c5331c0fa5f654
author: Gregory Maxwell <greg@xiph.org>
date: Sun Oct 21 15:42:03 EDT 2012

Also reject streams where a second packet begins but is not completed on the header pages.

--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -887,7 +887,7 @@
                if (!st)
                   quit(1);
 
-               if(ogg_stream_packetout(&os, &op)!=0)
+               if(ogg_stream_packetout(&os, &op)!=0 || og.header[og.header_len-1]==255)
                {
                   /*The format specifies that the initial header and tags packets are on their
                     own pages. To aid implementors in discovering that their files are wrong
@@ -927,7 +927,7 @@
             {
                if (!quiet)
                   print_comments((char*)op.packet, op.bytes);
-               if(ogg_stream_packetout(&os, &op)!=0)
+               if(ogg_stream_packetout(&os, &op)!=0 || og.header[og.header_len-1]==255)
                {
                   fprintf(stderr, "Extra packets on initial tags page. Invalid stream.\n");
                   quit(1);