Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2e4b3ffd
Commit
2e4b3ffd
authored
Feb 01, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inflate: add support for gzip (refs #16412)
parent
68e80594
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
modules/stream_filter/inflate.c
modules/stream_filter/inflate.c
+11
-3
No files found.
modules/stream_filter/inflate.c
View file @
2e4b3ffd
...
...
@@ -151,10 +151,18 @@ static int Open(vlc_object_t *obj)
{
stream_t
*
stream
=
(
stream_t
*
)
obj
;
const
uint8_t
*
peek
;
int
bits
;
/* See IETF RFC6713 */
if
(
stream_Peek
(
stream
->
p_source
,
&
peek
,
2
)
<
2
||
(
peek
[
0
]
&
0xF
)
!=
8
||
(
peek
[
0
]
>>
4
)
>
7
||
(
U16_AT
(
peek
)
%
31
)
!=
0
)
if
(
stream_Peek
(
stream
->
p_source
,
&
peek
,
2
)
<
2
)
return
VLC_EGENERIC
;
if
((
peek
[
0
]
&
0xF
)
==
8
&&
(
peek
[
0
]
>>
4
)
<
8
&&
(
U16_AT
(
peek
)
%
31
)
==
0
)
bits
=
15
;
/* zlib */
else
if
(
!
memcmp
(
peek
,
"
\x1F\x08B
"
,
2
))
bits
=
15
+
32
;
/* gzip */
else
return
VLC_EGENERIC
;
stream_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
...
...
@@ -168,7 +176,7 @@ static int Open(vlc_object_t *obj)
sys
->
zstream
.
opaque
=
Z_NULL
;
sys
->
eof
=
false
;
int
ret
=
inflateInit
(
&
sys
->
zstream
);
int
ret
=
inflateInit
2
(
&
sys
->
zstream
,
bits
);
if
(
ret
!=
Z_OK
)
{
free
(
sys
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment