Fix for incorrect abort in decoder_example triggered by short ogg files. Should now...
authorMike Smith <msmith@xiph.org>
Fri, 12 May 2000 05:50:11 +0000 (05:50 +0000)
committerMike Smith <msmith@xiph.org>
Fri, 12 May 2000 05:50:11 +0000 (05:50 +0000)
svn path=/trunk/vorbis/; revision=388

examples/decoder_example.c

index 1a1030f..23542af 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: simple example decoder
- last mod: $Id: decoder_example.c,v 1.5 2000/01/28 15:25:06 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.6 2000/05/12 05:50:11 msmith Exp $
 
  ********************************************************************/
 
@@ -144,7 +144,7 @@ int main(){
       /* no harm in not checking before adding more */
       buffer=ogg_sync_buffer(&oy,4096);
       bytes=fread(buffer,1,4096,stdin);
-      if(bytes==0){
+      if(bytes==0 && i < 2){
        fprintf(stderr,"End of file before finding all Vorbis headers!\n");
        exit(1);
       }