From ee911775715d0b3721938cad2e21823fe4b19bd7 Mon Sep 17 00:00:00 2001 From: "Timothy B. Terriberry" <tterribe@xiph.org> Date: Sun, 16 Mar 2014 10:24:33 -0700 Subject: [PATCH] Fix header reading for non-Opus streams. We were skipping the BOS page for non-Opus streams, but never read in the next page, causing setup to fail with a duplicate serial number validation error. Thanks to Lithopsian for the report. --- src/opusfile.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/opusfile.c b/src/opusfile.c index 1289504..2374bd2 100644 --- a/src/opusfile.c +++ b/src/opusfile.c @@ -496,13 +496,14 @@ static int op_fetch_headers_impl(OggOpusFile *_of,OpusHead *_head, ogg_stream_pagein(&_of->os,_og); if(OP_LIKELY(ogg_stream_packetout(&_of->os,&op)>0)){ ret=opus_head_parse(_head,op.packet,op.bytes); - /*If it's just a stream type we don't recognize, ignore it.*/ - if(ret==OP_ENOTFORMAT)continue; - /*Everything else is fatal.*/ - if(OP_UNLIKELY(ret<0))return ret; + if(OP_UNLIKELY(ret<0)){ + /*If it's just a stream type we don't recognize, ignore it. + Everything else is fatal.*/ + if(ret!=OP_ENOTFORMAT)return ret; + } /*Found a valid Opus header. Continue setup.*/ - _of->ready_state=OP_STREAMSET; + else _of->ready_state=OP_STREAMSET; } } /*Get the next page. -- GitLab