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
e96daf83
Commit
e96daf83
authored
Aug 30, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mjpeg: probe before malloc in one simple case
The code is still seriously brain damaged.
parent
b8df153b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
modules/demux/mjpeg.c
modules/demux/mjpeg.c
+5
-8
No files found.
modules/demux/mjpeg.c
View file @
e96daf83
...
@@ -324,11 +324,14 @@ static int SendBlock( demux_t *p_demux, int i )
...
@@ -324,11 +324,14 @@ static int SendBlock( demux_t *p_demux, int i )
static
int
Open
(
vlc_object_t
*
p_this
)
static
int
Open
(
vlc_object_t
*
p_this
)
{
{
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
;
int
i_size
;
int
i_size
;
bool
b_matched
=
false
;
bool
b_matched
=
false
;
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
if
(
IsMxpeg
(
p_demux
->
s
)
&&
!
p_demux
->
b_force
)
// let avformat handle this case
return
VLC_EGENERIC
;
demux_sys_t
*
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
if
(
unlikely
(
p_sys
==
NULL
)
)
if
(
unlikely
(
p_sys
==
NULL
)
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
...
@@ -341,12 +344,6 @@ static int Open( vlc_object_t * p_this )
...
@@ -341,12 +344,6 @@ static int Open( vlc_object_t * p_this )
p_sys
->
psz_separator
=
NULL
;
p_sys
->
psz_separator
=
NULL
;
p_sys
->
i_frame_size_estimate
=
15
*
1024
;
p_sys
->
i_frame_size_estimate
=
15
*
1024
;
if
(
IsMxpeg
(
p_demux
->
s
)
&&
!
p_demux
->
b_force
)
{
// let avformat handle this case
goto
error
;
}
b_matched
=
CheckMimeHeader
(
p_demux
,
&
i_size
);
b_matched
=
CheckMimeHeader
(
p_demux
,
&
i_size
);
if
(
b_matched
)
if
(
b_matched
)
{
{
...
...
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