[vlc-commits] rar: + Robust to non-specification header: Missing added block size flag.

John Peterson git at videolan.org
Thu May 3 01:00:00 CEST 2012


vlc | branch: master | John Peterson <john.peterson3 at hotmail.com> | Sun Apr 22 06:35:02 2012 +0200| [1fcf4a83a10cc1d668d5369682fe1f0330ac7e70] | committer: Laurent Aimar

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1fcf4a83a10cc1d668d5369682fe1f0330ac7e70
---

 modules/access/rar/rar.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/access/rar/rar.c b/modules/access/rar/rar.c
index 315c0a9..ce35504 100644
--- a/modules/access/rar/rar.c
+++ b/modules/access/rar/rar.c
@@ -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]);



More information about the vlc-commits mailing list