summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_ogg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index dabac757d9..dcb74c7bc3 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -262,6 +262,7 @@ static int demux_ogg_get_page_stream(ogg_demuxer_t* ogg_d,ogg_stream_state** os
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_packet(ogg_stream_t* os,ogg_packet* pack,fl
/* 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;