Commit c5bad949 authored by conrad's avatar conrad

oggz-chop: check for invalid track state in read_headers (defensive)


git-svn-id: http://svn.annodex.net/liboggz/trunk@3810 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent 0e5a0e7a
......@@ -670,17 +670,21 @@ read_headers (OGGZ * oggz, const ogg_page * og, long serialno, void * user_data)
fisbone_packet fisbone;
content_type = oggz_stream_get_content(oggz, serialno);
if(content_type == OGGZ_CONTENT_SKELETON) {
switch (content_type) {
case OGGZ_CONTENT_SKELETON:
if (fisbone_from_ogg_page (og, &fisbone) != -1) {
if ((ts = oggz_table_lookup (state->tracks, fisbone.serial_no)) != NULL) {
ts->fisbone.current_header_size = fisbone.current_header_size;
ts->fisbone.message_header_fields = fisbone.message_header_fields;
}
}
} else {
break;
default:
ts = oggz_table_lookup (state->tracks, serialno);
if (ts == NULL) break;
fwrite_ogg_page (state, og);
ts = oggz_table_lookup (state->tracks, serialno);
ts->headers_remaining -= ogg_page_packets (OGG_PAGE_CONST(og));
if (ts->headers_remaining <= 0) {
......
Markdown is supported
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