]> git.sesse.net Git - vlc/commitdiff
rar: + Robust to non-specification header: Missing added block size flag.
authorJohn Peterson <john.peterson3@hotmail.com>
Sun, 22 Apr 2012 04:35:02 +0000 (06:35 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 2 May 2012 22:56:53 +0000 (00:56 +0200)
modules/access/rar/rar.c

index 315c0a99e19d151fe644cb28d21fce7d499f739f..ce3550495642645736aaf69681dc6875ecf026f2 100644 (file)
@@ -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]);