Commit 1c61401f authored by John Peterson's avatar John Peterson Committed by Jean-Baptiste Kempf

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

(cherry picked from commit 1fcf4a83a10cc1d668d5369682fe1f0330ac7e70)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent cf2819b2
...@@ -66,6 +66,7 @@ enum { ...@@ -66,6 +66,7 @@ enum {
RAR_BLOCK_MARKER = 0x72, RAR_BLOCK_MARKER = 0x72,
RAR_BLOCK_ARCHIVE = 0x73, RAR_BLOCK_ARCHIVE = 0x73,
RAR_BLOCK_FILE = 0x74, RAR_BLOCK_FILE = 0x74,
RAR_BLOCK_SUBBLOCK = 0x7a,
RAR_BLOCK_END = 0x7b, RAR_BLOCK_END = 0x7b,
}; };
enum { enum {
...@@ -90,7 +91,9 @@ static int PeekBlock(stream_t *s, rar_block_t *hdr) ...@@ -90,7 +91,9 @@ static int PeekBlock(stream_t *s, rar_block_t *hdr)
hdr->flags = GetWLE(&peek[3]); hdr->flags = GetWLE(&peek[3]);
hdr->size = GetWLE(&peek[5]); hdr->size = GetWLE(&peek[5]);
hdr->add_size = 0; 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) if (peek_size < 11)
return VLC_EGENERIC; return VLC_EGENERIC;
hdr->add_size = GetDWLE(&peek[7]); 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