Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
566fe8b1
Commit
566fe8b1
authored
Jul 10, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Abort an demux allocation failures
parent
1cdbc7b6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
17 deletions
+22
-17
modules/demux/flac.c
modules/demux/flac.c
+1
-1
modules/demux/nuv.c
modules/demux/nuv.c
+2
-0
modules/demux/ogg.c
modules/demux/ogg.c
+1
-0
modules/demux/oggseek.c
modules/demux/oggseek.c
+1
-1
modules/demux/real.c
modules/demux/real.c
+5
-5
modules/demux/stl.c
modules/demux/stl.c
+2
-2
modules/demux/ts.c
modules/demux/ts.c
+8
-6
modules/demux/ty.c
modules/demux/ty.c
+2
-2
No files found.
modules/demux/flac.c
View file @
566fe8b1
...
@@ -406,7 +406,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -406,7 +406,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
*
pi_int
=
p_sys
->
i_attachments
;;
*
pi_int
=
p_sys
->
i_attachments
;;
*
ppp_attach
=
malloc
(
sizeof
(
input_attachment_t
**
)
*
p_sys
->
i_attachments
);
*
ppp_attach
=
x
malloc
(
sizeof
(
input_attachment_t
**
)
*
p_sys
->
i_attachments
);
for
(
i
=
0
;
i
<
p_sys
->
i_attachments
;
i
++
)
for
(
i
=
0
;
i
<
p_sys
->
i_attachments
;
i
++
)
(
*
ppp_attach
)[
i
]
=
vlc_input_attachment_Duplicate
(
p_sys
->
attachments
[
i
]
);
(
*
ppp_attach
)[
i
]
=
vlc_input_attachment_Duplicate
(
p_sys
->
attachments
[
i
]
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
modules/demux/nuv.c
View file @
566fe8b1
...
@@ -418,6 +418,8 @@ static int Demux( demux_t *p_demux )
...
@@ -418,6 +418,8 @@ static int Demux( demux_t *p_demux )
{
{
/* for rtjpeg data, the header is also needed */
/* for rtjpeg data, the header is also needed */
p_data
=
block_Realloc
(
p_data
,
NUV_FH_SIZE
,
fh
.
i_length
);
p_data
=
block_Realloc
(
p_data
,
NUV_FH_SIZE
,
fh
.
i_length
);
if
(
unlikely
(
!
p_data
)
)
abort
();
memcpy
(
p_data
->
p_buffer
,
p_sys
->
fh_buffer
,
NUV_FH_SIZE
);
memcpy
(
p_data
->
p_buffer
,
p_sys
->
fh_buffer
,
NUV_FH_SIZE
);
}
}
/* 0,1,2,3 -> rtjpeg, >=4 mpeg4 */
/* 0,1,2,3 -> rtjpeg, >=4 mpeg4 */
...
...
modules/demux/ogg.c
View file @
566fe8b1
...
@@ -628,6 +628,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
...
@@ -628,6 +628,7 @@ static void Ogg_DecodePacket( demux_t *p_demux,
}
}
else
else
{
{
#warning Memory leak
p_stream
->
i_headers
=
0
;
p_stream
->
i_headers
=
0
;
p_stream
->
p_headers
=
NULL
;
p_stream
->
p_headers
=
NULL
;
free
(
p_org
);
free
(
p_org
);
...
...
modules/demux/oggseek.c
View file @
566fe8b1
...
@@ -78,7 +78,7 @@ static demux_index_entry_t *index_entry_delete( demux_index_entry_t *idx )
...
@@ -78,7 +78,7 @@ static demux_index_entry_t *index_entry_delete( demux_index_entry_t *idx )
static
demux_index_entry_t
*
index_entry_new
(
void
)
static
demux_index_entry_t
*
index_entry_new
(
void
)
{
{
demux_index_entry_t
*
idx
=
(
demux_index_entry_t
*
)
malloc
(
sizeof
(
demux_index_entry_t
)
);
demux_index_entry_t
*
idx
=
x
malloc
(
sizeof
(
demux_index_entry_t
)
);
idx
->
p_next
=
idx
->
p_prev
=
NULL
;
idx
->
p_next
=
idx
->
p_prev
=
NULL
;
idx
->
i_pagepos_end
=
-
1
;
idx
->
i_pagepos_end
=
-
1
;
return
idx
;
return
idx
;
...
...
modules/demux/real.c
View file @
566fe8b1
...
@@ -963,7 +963,7 @@ static char *StreamReadString2( stream_t *s )
...
@@ -963,7 +963,7 @@ static char *StreamReadString2( stream_t *s )
if
(
i_length
<=
0
)
if
(
i_length
<=
0
)
return
NULL
;
return
NULL
;
char
*
psz_string
=
calloc
(
1
,
i_length
+
1
);
char
*
psz_string
=
x
calloc
(
1
,
i_length
+
1
);
stream_Read
(
s
,
psz_string
,
i_length
);
/* Valid even if !psz_string */
stream_Read
(
s
,
psz_string
,
i_length
);
/* Valid even if !psz_string */
...
@@ -1661,18 +1661,18 @@ static int CodecAudioParse( demux_t *p_demux, int i_tk_id, const uint8_t *p_data
...
@@ -1661,18 +1661,18 @@ static int CodecAudioParse( demux_t *p_demux, int i_tk_id, const uint8_t *p_data
tk
->
i_subpackets
=
tk
->
i_subpackets
=
i_subpacket_h
*
i_frame_size
/
tk
->
i_subpacket_size
;
i_subpacket_h
*
i_frame_size
/
tk
->
i_subpacket_size
;
tk
->
p_subpackets
=
tk
->
p_subpackets
=
calloc
(
tk
->
i_subpackets
,
sizeof
(
block_t
*
)
);
x
calloc
(
tk
->
i_subpackets
,
sizeof
(
block_t
*
)
);
tk
->
p_subpackets_timecode
=
tk
->
p_subpackets_timecode
=
calloc
(
tk
->
i_subpackets
,
sizeof
(
int64_t
)
);
x
calloc
(
tk
->
i_subpackets
,
sizeof
(
int64_t
)
);
}
}
else
if
(
fmt
.
i_codec
==
VLC_CODEC_RA_288
)
else
if
(
fmt
.
i_codec
==
VLC_CODEC_RA_288
)
{
{
tk
->
i_subpackets
=
tk
->
i_subpackets
=
i_subpacket_h
*
i_frame_size
/
tk
->
i_coded_frame_size
;
i_subpacket_h
*
i_frame_size
/
tk
->
i_coded_frame_size
;
tk
->
p_subpackets
=
tk
->
p_subpackets
=
calloc
(
tk
->
i_subpackets
,
sizeof
(
block_t
*
)
);
x
calloc
(
tk
->
i_subpackets
,
sizeof
(
block_t
*
)
);
tk
->
p_subpackets_timecode
=
tk
->
p_subpackets_timecode
=
calloc
(
tk
->
i_subpackets
,
sizeof
(
int64_t
)
);
x
calloc
(
tk
->
i_subpackets
,
sizeof
(
int64_t
)
);
}
}
/* Check if the calloc went correctly */
/* Check if the calloc went correctly */
...
...
modules/demux/stl.c
View file @
566fe8b1
...
@@ -175,11 +175,11 @@ static int Open(vlc_object_t *object)
...
@@ -175,11 +175,11 @@ static int Open(vlc_object_t *object)
const
int
tti_count
=
ParseInteger
(
&
header
[
238
],
5
);
const
int
tti_count
=
ParseInteger
(
&
header
[
238
],
5
);
msg_Dbg
(
demux
,
"Detected EBU STL : CCT=%d TTI=%d start=%8.8s %lld"
,
cct
,
tti_count
,
&
header
[
256
],
program_start
);
msg_Dbg
(
demux
,
"Detected EBU STL : CCT=%d TTI=%d start=%8.8s %lld"
,
cct
,
tti_count
,
&
header
[
256
],
program_start
);
demux_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
demux_sys_t
*
sys
=
x
malloc
(
sizeof
(
*
sys
));
sys
->
next_date
=
0
;
sys
->
next_date
=
0
;
sys
->
current
=
0
;
sys
->
current
=
0
;
sys
->
count
=
0
;
sys
->
count
=
0
;
sys
->
index
=
calloc
(
tti_count
,
sizeof
(
*
sys
->
index
));
sys
->
index
=
x
calloc
(
tti_count
,
sizeof
(
*
sys
->
index
));
bool
comment
=
false
;
bool
comment
=
false
;
...
...
modules/demux/ts.c
View file @
566fe8b1
...
@@ -503,10 +503,10 @@ static int Open( vlc_object_t *p_this )
...
@@ -503,10 +503,10 @@ static int Open( vlc_object_t *p_this )
* http://www.i-topfield.com/data/product/firmware/Structure%20of%20Recorded%20File%20in%20TF5000PVR%20(Feb%2021%202004).doc
* http://www.i-topfield.com/data/product/firmware/Structure%20of%20Recorded%20File%20in%20TF5000PVR%20(Feb%2021%202004).doc
* but after the filename the offsets seem to be incorrect. - DJ */
* but after the filename the offsets seem to be incorrect. - DJ */
int i_duration, i_name;
int i_duration, i_name;
char *psz_name = malloc(25);
char *psz_name =
x
malloc(25);
char *psz_event_name;
char *psz_event_name;
char *psz_event_text = malloc(130);
char *psz_event_text =
x
malloc(130);
char *psz_ext_text = malloc(1025);
char *psz_ext_text =
x
malloc(1025);
// 2 bytes version Uimsbf (4,5)
// 2 bytes version Uimsbf (4,5)
// 2 bytes reserved (6,7)
// 2 bytes reserved (6,7)
...
@@ -541,7 +541,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -541,7 +541,7 @@ static int Open( vlc_object_t *p_this )
// 1 byte event name length Uimsbf (89)
// 1 byte event name length Uimsbf (89)
i_name = (int)(p_peek[89]&~0x81);
i_name = (int)(p_peek[89]&~0x81);
msg_Dbg( p_demux, "event name length = %d", i_name);
msg_Dbg( p_demux, "event name length = %d", i_name);
psz_event_name = malloc( i_name+1 );
psz_event_name =
x
malloc( i_name+1 );
// 1 byte parental rating (90)
// 1 byte parental rating (90)
// 129 bytes of event text
// 129 bytes of event text
memcpy( psz_event_name, &p_peek[91], i_name );
memcpy( psz_event_name, &p_peek[91], i_name );
...
@@ -727,7 +727,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -727,7 +727,7 @@ static int Open( vlc_object_t *p_this )
{
{
p_sys
->
i_ts_read
=
1500
/
p_sys
->
i_packet_size
;
p_sys
->
i_ts_read
=
1500
/
p_sys
->
i_packet_size
;
}
}
p_sys
->
buffer
=
malloc
(
p_sys
->
i_packet_size
*
p_sys
->
i_ts_read
);
p_sys
->
buffer
=
x
malloc
(
p_sys
->
i_packet_size
*
p_sys
->
i_ts_read
);
}
}
}
}
free
(
psz_string
);
free
(
psz_string
);
...
@@ -1829,6 +1829,8 @@ static void ParsePES( demux_t *p_demux, ts_pid_t *pid )
...
@@ -1829,6 +1829,8 @@ static void ParsePES( demux_t *p_demux, ts_pid_t *pid )
}
}
/* Append a \0 */
/* Append a \0 */
p_block
=
block_Realloc
(
p_block
,
0
,
p_block
->
i_buffer
+
1
);
p_block
=
block_Realloc
(
p_block
,
0
,
p_block
->
i_buffer
+
1
);
if
(
!
p_block
)
abort
();
p_block
->
p_buffer
[
p_block
->
i_buffer
-
1
]
=
'\0'
;
p_block
->
p_buffer
[
p_block
->
i_buffer
-
1
]
=
'\0'
;
}
}
...
@@ -2405,7 +2407,7 @@ static iod_descriptor_t *IODNew( int i_data, uint8_t *p_data )
...
@@ -2405,7 +2407,7 @@ static iod_descriptor_t *IODNew( int i_data, uint8_t *p_data )
if
(
dec_descr
.
i_decoder_specific_info_len
>
0
)
if
(
dec_descr
.
i_decoder_specific_info_len
>
0
)
{
{
dec_descr
.
p_decoder_specific_info
=
dec_descr
.
p_decoder_specific_info
=
malloc
(
dec_descr
.
i_decoder_specific_info_len
);
x
malloc
(
dec_descr
.
i_decoder_specific_info_len
);
}
}
for
(
i
=
0
;
i
<
dec_descr
.
i_decoder_specific_info_len
;
i
++
)
for
(
i
=
0
;
i
<
dec_descr
.
i_decoder_specific_info_len
;
i
++
)
{
{
...
...
modules/demux/ty.c
View file @
566fe8b1
...
@@ -1892,7 +1892,7 @@ static int get_chunk_header(demux_t *p_demux)
...
@@ -1892,7 +1892,7 @@ static int get_chunk_header(demux_t *p_demux)
stream_Read
(
p_demux
->
s
,
NULL
,
4
);
stream_Read
(
p_demux
->
s
,
NULL
,
4
);
/* read the record headers into a temp buffer */
/* read the record headers into a temp buffer */
p_hdr_buf
=
malloc
(
i_num_recs
*
16
);
p_hdr_buf
=
x
malloc
(
i_num_recs
*
16
);
if
(
stream_Read
(
p_demux
->
s
,
p_hdr_buf
,
i_num_recs
*
16
)
<
i_num_recs
*
16
)
{
if
(
stream_Read
(
p_demux
->
s
,
p_hdr_buf
,
i_num_recs
*
16
)
<
i_num_recs
*
16
)
{
free
(
p_hdr_buf
);
free
(
p_hdr_buf
);
p_sys
->
eof
=
true
;
p_sys
->
eof
=
true
;
...
@@ -1919,7 +1919,7 @@ static ty_rec_hdr_t *parse_chunk_headers( const uint8_t *p_buf,
...
@@ -1919,7 +1919,7 @@ static ty_rec_hdr_t *parse_chunk_headers( const uint8_t *p_buf,
ty_rec_hdr_t
*
p_hdrs
,
*
p_rec_hdr
;
ty_rec_hdr_t
*
p_hdrs
,
*
p_rec_hdr
;
*
pi_payload_size
=
0
;
*
pi_payload_size
=
0
;
p_hdrs
=
malloc
(
i_num_recs
*
sizeof
(
ty_rec_hdr_t
));
p_hdrs
=
x
malloc
(
i_num_recs
*
sizeof
(
ty_rec_hdr_t
));
for
(
i
=
0
;
i
<
i_num_recs
;
i
++
)
for
(
i
=
0
;
i
<
i_num_recs
;
i
++
)
{
{
...
...
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