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
fb4754ad
Commit
fb4754ad
authored
Jul 10, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AVI: abort on allocation failure
parent
9c14964b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
modules/demux/avi/libavi.c
modules/demux/avi/libavi.c
+10
-10
No files found.
modules/demux/avi/libavi.c
View file @
fb4754ad
...
...
@@ -162,7 +162,7 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
msg_Dbg
(
(
vlc_object_t
*
)
s
,
"<list
\'
%4.4s
\'
>"
,
(
char
*
)
&
p_container
->
list
.
i_type
);
for
(
;
;
)
{
p_chk
=
malloc
(
sizeof
(
avi_chunk_t
)
);
p_chk
=
x
malloc
(
sizeof
(
avi_chunk_t
)
);
memset
(
p_chk
,
0
,
sizeof
(
avi_chunk_t
)
);
if
(
!
p_container
->
common
.
p_first
)
{
...
...
@@ -335,7 +335,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk )
{
case
(
AVIFOURCC_auds
):
p_chk
->
strf
.
auds
.
i_cat
=
AUDIO_ES
;
p_chk
->
strf
.
auds
.
p_wf
=
malloc
(
__MAX
(
p_chk
->
common
.
i_chunk_size
,
sizeof
(
WAVEFORMATEX
)
)
);
p_chk
->
strf
.
auds
.
p_wf
=
x
malloc
(
__MAX
(
p_chk
->
common
.
i_chunk_size
,
sizeof
(
WAVEFORMATEX
)
)
);
AVI_READ2BYTES
(
p_chk
->
strf
.
auds
.
p_wf
->
wFormatTag
);
AVI_READ2BYTES
(
p_chk
->
strf
.
auds
.
p_wf
->
nChannels
);
AVI_READ4BYTES
(
p_chk
->
strf
.
auds
.
p_wf
->
nSamplesPerSec
);
...
...
@@ -384,7 +384,7 @@ static int AVI_ChunkRead_strf( stream_t *s, avi_chunk_t *p_chk )
case
(
AVIFOURCC_vids
):
p_strh
->
strh
.
i_samplesize
=
0
;
/* XXX for ffmpeg avi file */
p_chk
->
strf
.
vids
.
i_cat
=
VIDEO_ES
;
p_chk
->
strf
.
vids
.
p_bih
=
malloc
(
__MAX
(
p_chk
->
common
.
i_chunk_size
,
p_chk
->
strf
.
vids
.
p_bih
=
x
malloc
(
__MAX
(
p_chk
->
common
.
i_chunk_size
,
sizeof
(
*
p_chk
->
strf
.
vids
.
p_bih
)
)
);
AVI_READ4BYTES
(
p_chk
->
strf
.
vids
.
p_bih
->
biSize
);
AVI_READ4BYTES
(
p_chk
->
strf
.
vids
.
p_bih
->
biWidth
);
...
...
@@ -440,7 +440,7 @@ static void AVI_ChunkFree_strf( avi_chunk_t *p_chk )
static
int
AVI_ChunkRead_strd
(
stream_t
*
s
,
avi_chunk_t
*
p_chk
)
{
AVI_READCHUNK_ENTER
;
p_chk
->
strd
.
p_data
=
malloc
(
p_chk
->
common
.
i_chunk_size
);
p_chk
->
strd
.
p_data
=
x
malloc
(
p_chk
->
common
.
i_chunk_size
);
memcpy
(
p_chk
->
strd
.
p_data
,
p_buff
+
8
,
p_chk
->
common
.
i_chunk_size
);
AVI_READCHUNK_EXIT
(
VLC_SUCCESS
);
}
...
...
@@ -462,7 +462,7 @@ static int AVI_ChunkRead_idx1( stream_t *s, avi_chunk_t *p_chk )
p_chk
->
idx1
.
i_entry_max
=
i_count
;
if
(
i_count
>
0
)
{
p_chk
->
idx1
.
entry
=
calloc
(
i_count
,
sizeof
(
idx1_entry_t
)
);
p_chk
->
idx1
.
entry
=
x
calloc
(
i_count
,
sizeof
(
idx1_entry_t
)
);
for
(
i_index
=
0
;
i_index
<
i_count
;
i_index
++
)
{
...
...
@@ -516,7 +516,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
i_count
=
__MIN
(
p_indx
->
i_entriesinuse
,
i_read
/
8
);
p_indx
->
i_entriesinuse
=
i_count
;
p_indx
->
idx
.
std
=
calloc
(
i_count
,
sizeof
(
indx_std_entry_t
)
);
p_indx
->
idx
.
std
=
x
calloc
(
i_count
,
sizeof
(
indx_std_entry_t
)
);
for
(
i
=
0
;
i
<
i_count
;
i
++
)
{
...
...
@@ -531,7 +531,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
i_count
=
__MIN
(
p_indx
->
i_entriesinuse
,
i_read
/
12
);
p_indx
->
i_entriesinuse
=
i_count
;
p_indx
->
idx
.
field
=
calloc
(
i_count
,
sizeof
(
indx_field_entry_t
)
);
p_indx
->
idx
.
field
=
x
calloc
(
i_count
,
sizeof
(
indx_field_entry_t
)
);
for
(
i
=
0
;
i
<
i_count
;
i
++
)
{
AVI_READ4BYTES
(
p_indx
->
idx
.
field
[
i
].
i_offset
);
...
...
@@ -548,7 +548,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
i_count
=
__MIN
(
p_indx
->
i_entriesinuse
,
i_read
/
16
);
p_indx
->
i_entriesinuse
=
i_count
;
p_indx
->
idx
.
super
=
calloc
(
i_count
,
sizeof
(
indx_super_entry_t
)
);
p_indx
->
idx
.
super
=
x
calloc
(
i_count
,
sizeof
(
indx_super_entry_t
)
);
for
(
i
=
0
;
i
<
i_count
;
i
++
)
{
...
...
@@ -627,7 +627,7 @@ static int AVI_ChunkRead_strz( stream_t *s, avi_chunk_t *p_chk )
}
}
p_strz
->
p_type
=
strdup
(
AVI_strz_type
[
i_index
].
psz_type
);
p_strz
->
p_str
=
malloc
(
p_strz
->
i_chunk_size
+
1
);
p_strz
->
p_str
=
x
malloc
(
p_strz
->
i_chunk_size
+
1
);
if
(
p_strz
->
i_chunk_size
)
{
...
...
@@ -862,7 +862,7 @@ int AVI_ChunkReadRoot( stream_t *s, avi_chunk_t *p_root )
for
(
;
;
)
{
p_chk
=
malloc
(
sizeof
(
avi_chunk_t
)
);
p_chk
=
x
malloc
(
sizeof
(
avi_chunk_t
)
);
memset
(
p_chk
,
0
,
sizeof
(
avi_chunk_t
)
);
if
(
!
p_root
->
common
.
p_first
)
{
...
...
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