mirror of
https://github.com/fmang/opustags.git
synced 2025-01-15 20:53:16 +01:00
reject continued header pages
This commit is contained in:
parent
c01045172c
commit
4e3ee61ca3
@ -35,6 +35,8 @@ ot::status ot::ogg_reader::read_page()
|
||||
|
||||
ot::status ot::ogg_reader::read_header_packet(const std::function<status(ogg_packet&)>& f)
|
||||
{
|
||||
if (ogg_page_continued(&page))
|
||||
return {ot::st::error, "Unexpected continued header page."};
|
||||
ogg_stream stream(ogg_page_serialno(&page));
|
||||
stream.pageno = ogg_page_pageno(&page);
|
||||
if (ogg_stream_pagein(&stream, &page) != 0)
|
||||
|
@ -175,9 +175,9 @@ struct ogg_reader {
|
||||
*/
|
||||
status read_page();
|
||||
/**
|
||||
* Read the single packet contained in a header page, and call the function f on it. This
|
||||
* function has no side effect, and calling it twice on the same page will read the same
|
||||
* packet again.
|
||||
* Read the single packet contained in the last page read, assuming it's a header page, and
|
||||
* call the function f on it. This function has no side effect, and calling it twice on the
|
||||
* same page will read the same packet again.
|
||||
*
|
||||
* It is currently limited to packets that fit on a single page, and should be later
|
||||
* extended to support packets spanning multiple pages.
|
||||
|
Loading…
x
Reference in New Issue
Block a user