Commit 15193c53 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Check for end_offset < data_offset.

I don't think it actually breaks anything if we don't (seeking will
 fail, but it will fail cleanly).
However, it _is_ an indication that the file data changed out from
 under us (or of another library bug), so we should fail fast.
parent 4dcf9b0d
...@@ -967,6 +967,8 @@ static int op_find_final_pcm_offset(OggOpusFile *_of, ...@@ -967,6 +967,8 @@ static int op_find_final_pcm_offset(OggOpusFile *_of,
cur_serialno,_serialnos,_nserialnos); cur_serialno,_serialnos,_nserialnos);
if(OP_UNLIKELY(_offset<0))return (int)_offset; if(OP_UNLIKELY(_offset<0))return (int)_offset;
} }
/*At worst we should have found the first page with completed packets.*/
if(OP_UNLIKELY(_offset<_link->data_offset))return OP_EBADLINK;
/*This implementation requires that the difference between the first and last /*This implementation requires that the difference between the first and last
granule positions in each link be representable in a signed, 64-bit granule positions in each link be representable in a signed, 64-bit
number, and that each link also have at least as many samples as the number, and that each link also have at least as many samples as the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment