diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-09 19:19:32 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-09 19:19:32 +0000 |
commit | da87897b1b5778e1ef7cc6b5c0de95bd2a887fa7 (patch) | |
tree | a3270cf3bce4a78098803aa5ab6a1087e695ae5f /libmpdemux | |
parent | cd4d5a8f2f65331c7269acf8fe69634f9974f335 (diff) | |
download | mpv-da87897b1b5778e1ef7cc6b5c0de95bd2a887fa7.tar.bz2 mpv-da87897b1b5778e1ef7cc6b5c0de95bd2a887fa7.tar.xz |
Improve handling of 0-size ogg packets.
Fixes bug 1664.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30878 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_ogg.c | 3 |
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; |