[xiph-cvs] cvs commit: vorbis-tools/ogginfo ogginfo2.c

Michael Smith msmith at xiph.org
Sat Jul 6 00:07:25 PDT 2002



msmith      02/07/06 00:07:25

  Modified:    ogginfo  ogginfo2.c
  Log:
  Missing EOS flag on non-vorbis streams caused crash. fix.

Revision  Changes    Path
1.8       +15 -2     vorbis-tools/ogginfo/ogginfo2.c

Index: ogginfo2.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogginfo/ogginfo2.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ogginfo2.c	2002/07/06 04:21:42	1.7
+++ ogginfo2.c	2002/07/06 07:07:24	1.8
@@ -356,6 +356,11 @@
     free(stream->data);
 }
 
+static void process_null(stream_processor *stream, ogg_page *page)
+{
+    /* This is for invalid streams. */
+}
+
 static void process_other(stream_processor *stream, ogg_page *page )
 {
     ogg_packet packet;
@@ -375,7 +380,8 @@
         if(!set->streams[i].end) {
             warn(_("Warning: EOS not set on stream %d\n"), 
                     set->streams[i].num);
-            set->streams[i].process_end(&set->streams[i]);
+            if(set->streams[i].process_end)
+                set->streams[i].process_end(&set->streams[i]);
         }
         ogg_stream_clear(&set->streams[i].os);
     }
@@ -396,6 +402,13 @@
     return res;
 }
 
+static void null_start(stream_processor *stream)
+{
+    stream->process_end = NULL;
+    stream->type = "invalid";
+    stream->process_page = process_null;
+}
+
 static void other_start(stream_processor *stream, char *type)
 {
     if(type)
@@ -485,7 +498,7 @@
         res = ogg_stream_packetout(&stream->os, &packet);
         if(res <= 0) {
             warn(_("Warning: Invalid header page, no packet found\n"));
-            other_start(stream, NULL);
+            null_start(stream);
         }
         else if(packet.bytes >= 7 && memcmp(packet.packet, "\001vorbis", 7)==0)
             vorbis_start(stream);

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list