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
0123bbfc
Commit
0123bbfc
authored
Jan 14, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport [18573:18578] various leaks and crashes
parent
ea1c2e19
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
22 deletions
+46
-22
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+1
-0
modules/demux/asf/libasf.c
modules/demux/asf/libasf.c
+24
-2
modules/demux/avi/libavi.c
modules/demux/avi/libavi.c
+21
-20
No files found.
modules/demux/asf/asf.c
View file @
0123bbfc
...
@@ -123,6 +123,7 @@ static int Open( vlc_object_t * p_this )
...
@@ -123,6 +123,7 @@ static int Open( vlc_object_t * p_this )
/* Load the headers */
/* Load the headers */
if
(
DemuxInit
(
p_demux
)
)
if
(
DemuxInit
(
p_demux
)
)
{
{
free
(
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
modules/demux/asf/libasf.c
View file @
0123bbfc
...
@@ -492,13 +492,14 @@ static int ASF_ReadObject_stream_properties( stream_t *s, asf_object_t *p_obj )
...
@@ -492,13 +492,14 @@ static int ASF_ReadObject_stream_properties( stream_t *s, asf_object_t *p_obj )
{
{
asf_object_stream_properties_t
*
p_sp
=
asf_object_stream_properties_t
*
p_sp
=
(
asf_object_stream_properties_t
*
)
p_obj
;
(
asf_object_stream_properties_t
*
)
p_obj
;
int
i_peek
;
size_t
i_peek
;
uint8_t
*
p_peek
;
uint8_t
*
p_peek
;
if
(
(
i_peek
=
stream_Peek
(
s
,
&
p_peek
,
p_sp
->
i_object_size
)
)
<
7
4
)
if
(
(
i_peek
=
stream_Peek
(
s
,
&
p_peek
,
p_sp
->
i_object_size
)
)
<
7
8
)
{
{
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
ASF_GetGUID
(
&
p_sp
->
i_stream_type
,
p_peek
+
24
);
ASF_GetGUID
(
&
p_sp
->
i_stream_type
,
p_peek
+
24
);
ASF_GetGUID
(
&
p_sp
->
i_error_correction_type
,
p_peek
+
40
);
ASF_GetGUID
(
&
p_sp
->
i_error_correction_type
,
p_peek
+
40
);
p_sp
->
i_time_offset
=
GetQWLE
(
p_peek
+
56
);
p_sp
->
i_time_offset
=
GetQWLE
(
p_peek
+
56
);
...
@@ -507,21 +508,42 @@ static int ASF_ReadObject_stream_properties( stream_t *s, asf_object_t *p_obj )
...
@@ -507,21 +508,42 @@ static int ASF_ReadObject_stream_properties( stream_t *s, asf_object_t *p_obj )
p_sp
->
i_flags
=
GetWLE
(
p_peek
+
72
);
p_sp
->
i_flags
=
GetWLE
(
p_peek
+
72
);
p_sp
->
i_stream_number
=
p_sp
->
i_flags
&
0x07f
;
p_sp
->
i_stream_number
=
p_sp
->
i_flags
&
0x07f
;
p_sp
->
i_reserved
=
GetDWLE
(
p_peek
+
74
);
p_sp
->
i_reserved
=
GetDWLE
(
p_peek
+
74
);
i_peek
-=
78
;
if
(
p_sp
->
i_type_specific_data_length
)
if
(
p_sp
->
i_type_specific_data_length
)
{
{
if
(
i_peek
<
p_sp
->
i_type_specific_data_length
)
return
VLC_EGENERIC
;
p_sp
->
p_type_specific_data
=
p_sp
->
p_type_specific_data
=
malloc
(
p_sp
->
i_type_specific_data_length
);
malloc
(
p_sp
->
i_type_specific_data_length
);
if
(
p_sp
->
p_type_specific_data
==
NULL
)
return
VLC_ENOMEM
;
memcpy
(
p_sp
->
p_type_specific_data
,
p_peek
+
78
,
memcpy
(
p_sp
->
p_type_specific_data
,
p_peek
+
78
,
p_sp
->
i_type_specific_data_length
);
p_sp
->
i_type_specific_data_length
);
i_peek
-=
p_sp
->
i_type_specific_data_length
;
}
}
else
else
{
{
p_sp
->
p_type_specific_data
=
NULL
;
p_sp
->
p_type_specific_data
=
NULL
;
}
}
if
(
p_sp
->
i_error_correction_data_length
)
if
(
p_sp
->
i_error_correction_data_length
)
{
{
if
(
i_peek
<
p_sp
->
i_error_correction_data_length
)
{
free
(
p_sp
->
p_type_specific_data
);
return
VLC_EGENERIC
;
}
p_sp
->
p_error_correction_data
=
p_sp
->
p_error_correction_data
=
malloc
(
p_sp
->
i_error_correction_data_length
);
malloc
(
p_sp
->
i_error_correction_data_length
);
if
(
p_sp
->
p_error_correction_data
==
NULL
)
{
free
(
p_sp
->
p_type_specific_data
);
return
VLC_ENOMEM
;
}
memcpy
(
p_sp
->
p_error_correction_data
,
memcpy
(
p_sp
->
p_error_correction_data
,
p_peek
+
78
+
p_sp
->
i_type_specific_data_length
,
p_peek
+
78
+
p_sp
->
i_type_specific_data_length
,
p_sp
->
i_error_correction_data_length
);
p_sp
->
i_error_correction_data_length
);
...
...
modules/demux/avi/libavi.c
View file @
0123bbfc
...
@@ -207,43 +207,44 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
...
@@ -207,43 +207,44 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
i_read = stream_Read( s, p_read, i_read ); \
i_read = stream_Read( s, p_read, i_read ); \
if( i_read < (int64_t)__EVEN(p_chk->common.i_chunk_size ) + 8 ) \
if( i_read < (int64_t)__EVEN(p_chk->common.i_chunk_size ) + 8 ) \
{ \
{ \
free( p_buff ); \
return VLC_EGENERIC; \
return VLC_EGENERIC; \
}\
}\
p_read += 8; \
p_read += 8; \
i_read -= 8
i_read -= 8
#define AVI_READ( res, func, size ) \
if( i_read < size ) { \
free( p_buff); \
return VLC_EGENERIC; \
} \
i_read -= size; \
res = func( p_read ); \
p_read += size \
#define AVI_READCHUNK_EXIT( code ) \
#define AVI_READCHUNK_EXIT( code ) \
free( p_buff ); \
free( p_buff ); \
if( i_read < 0 ) \
{ \
msg_Warn( (vlc_object_t*)s, "not enough data" ); \
} \
return code
return code
static
inline
uint8_t
GetB
(
uint8_t
*
ptr
)
{
return
*
ptr
;
}
#define AVI_READ1BYTE( i_byte ) \
#define AVI_READ1BYTE( i_byte ) \
i_byte = *p_read; \
AVI_READ( i_byte, GetB, 1 )
p_read++; \
i_read--
#define AVI_READ2BYTES( i_word ) \
#define AVI_READ2BYTES( i_word ) \
i_word = GetWLE( p_read ); \
AVI_READ( i_word, GetWLE, 2 )
p_read += 2; \
i_read -= 2
#define AVI_READ4BYTES( i_dword ) \
#define AVI_READ4BYTES( i_dword ) \
i_dword = GetDWLE( p_read ); \
AVI_READ( i_dword, GetDWLE, 4 )
p_read += 4; \
i_read -= 4
#define AVI_READ8BYTES( i_dword ) \
#define AVI_READ8BYTES( i_qword ) \
i_dword = GetQWLE( p_read ); \
AVI_READ( i_qword, GetQWLE, 8 )
p_read += 8; \
i_read -= 8
#define AVI_READFOURCC( i_dword ) \
#define AVI_READFOURCC( i_dword ) \
i_dword = GetFOURCC( p_read ); \
AVI_READ( i_dword, GetFOURCC, 4 )
p_read += 4; \
i_read -= 4
static
int
AVI_ChunkRead_avih
(
stream_t
*
s
,
avi_chunk_t
*
p_chk
)
static
int
AVI_ChunkRead_avih
(
stream_t
*
s
,
avi_chunk_t
*
p_chk
)
{
{
...
...
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