[MPlayer-cvslog] r30878 - trunk/libmpdemux/demux_ogg.c

reimar subversion at mplayerhq.hu
Tue Mar 9 20:19:32 CET 2010


Author: reimar
Date: Tue Mar  9 20:19:32 2010
New Revision: 30878

Log:
Improve handling of 0-size ogg packets.
Fixes bug 1664.

Modified:
   trunk/libmpdemux/demux_ogg.c

Modified: trunk/libmpdemux/demux_ogg.c
==============================================================================
--- trunk/libmpdemux/demux_ogg.c	Tue Mar  9 19:34:14 2010	(r30877)
+++ trunk/libmpdemux/demux_ogg.c	Tue Mar  9 20:19:32 2010	(r30878)
@@ -262,6 +262,7 @@ static  int demux_ogg_get_page_stream(og
 
 static unsigned char* demux_ogg_read_packet(ogg_stream_t* os,ogg_packet* pack,float* pts,int* flags, int samplesize) {
   unsigned char* data = pack->packet;
+  int size = pack->bytes;
 
   *pts = 0;
   *flags = 0;
@@ -300,7 +301,7 @@ static unsigned char* demux_ogg_read_pac
      /* header packets begin on 1-bit: thus check (*data&0x80).  We don't
 	have theora_state st, until all header packets were passed to the
 	decoder. */
-     if (!(*data&0x80))
+     if (!size || !(*data&0x80))
      {
         int keyframe_granule_shift=_ilog(os->keyframe_frequency_force-1);
         int64_t iframemask = (1 << keyframe_granule_shift) - 1;


More information about the MPlayer-cvslog mailing list