Commit 1fcf4a83 authored by John Peterson's avatar John Peterson Committed by Laurent Aimar

rar: + Robust to non-specification header: Missing added block size flag.

parent c9ef39b1
......@@ -66,6 +66,7 @@ enum {
RAR_BLOCK_MARKER = 0x72,
RAR_BLOCK_ARCHIVE = 0x73,
RAR_BLOCK_FILE = 0x74,
RAR_BLOCK_SUBBLOCK = 0x7a,
RAR_BLOCK_END = 0x7b,
};
enum {
......@@ -90,7 +91,9 @@ static int PeekBlock(stream_t *s, rar_block_t *hdr)
hdr->flags = GetWLE(&peek[3]);
hdr->size = GetWLE(&peek[5]);
hdr->add_size = 0;
if (hdr->flags & 0x8000) {
if ((hdr->flags & 0x8000) ||
hdr->type == RAR_BLOCK_FILE ||
hdr->type == RAR_BLOCK_SUBBLOCK) {
if (peek_size < 11)
return VLC_EGENERIC;
hdr->add_size = GetDWLE(&peek[7]);
......
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