[vlc-devel] [PATCH] archive: Add support for RAR 5.0 format

Francois Cartegnie fcvlcdev at free.fr
Sun Nov 3 00:27:17 CET 2019


Le 03/11/2019 à 00:23, Johan Gunnarsson a écrit :
> libarchive 3.4.0 adds support for RAR 5.0. See
> https://www.rarlab.com/technote.htm#rarsign for description of signatures.
> ---
>  modules/stream_extractor/archive.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/stream_extractor/archive.c b/modules/stream_extractor/archive.c
> index 3498bd2fb9..61fcc4c245 100644
> --- a/modules/stream_extractor/archive.c
> +++ b/modules/stream_extractor/archive.c
> @@ -453,7 +453,8 @@ static int probe( stream_t* source )
>      } const magicbytes[] = {
>          /* keep heaviest at top */
>          { 257, 5, "ustar" },              //TAR
> -        { 0,   7, "Rar!\x1A\x07" },       //RAR
> +        { 0,   8, "Rar!\x1A\x07\x01" },   //RAR5.0
> +        { 0,   7, "Rar!\x1A\x07" },       //RAR4.x

Maybe we should just probing the 6 first bytes.

>          { 0,   6, "7z\xBC\xAF\x27\x1C" }, //7z
>          { 0,   4, "xar!" },               //XAR
>          { 0,   4, "PK\x03\x04" },         //ZIP
> 


-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list