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
def276b7
Commit
def276b7
authored
Mar 11, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check malloc return value and fix a memory leak.
parent
570cece5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
modules/demux/tta.c
modules/demux/tta.c
+23
-1
No files found.
modules/demux/tta.c
View file @
def276b7
...
...
@@ -109,6 +109,8 @@ static int Open( vlc_object_t * p_this )
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
if
(
!
p_sys
)
return
VLC_EGENERIC
;
/* Read the metadata */
es_format_Init
(
&
fmt
,
AUDIO_ES
,
VLC_FOURCC
(
'T'
,
'T'
,
'A'
,
'1'
)
);
...
...
@@ -125,8 +127,20 @@ static int Open( vlc_object_t * p_this )
i_seektable_size
=
sizeof
(
uint32_t
)
*
p_sys
->
i_totalframes
;
p_seektable
=
(
uint8_t
*
)
malloc
(
i_seektable_size
);
if
(
!
p_seektable
)
{
free
(
p_sys
);
return
VLC_EGENERIC
;
}
stream_Read
(
p_demux
->
s
,
p_seektable
,
i_seektable_size
);
p_sys
->
pi_seektable
=
(
uint32_t
*
)
malloc
(
i_seektable_size
);
p_sys
->
pi_seektable
=
(
uint32_t
*
)
malloc
(
i_seektable_size
);
if
(
!
p_sys
->
pi_seektable
)
{
free
(
p_seektable
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
for
(
i
=
0
;
i
<
p_sys
->
i_totalframes
;
i
++
)
p_sys
->
pi_seektable
[
i
]
=
GetDWLE
(
&
p_seektable
[
i
*
4
]
);
...
...
@@ -136,6 +150,13 @@ static int Open( vlc_object_t * p_this )
/* Store the header and Seektable for avcodec */
fmt
.
i_extra
=
22
+
(
p_sys
->
i_totalframes
*
4
)
+
4
;
fmt
.
p_extra
=
malloc
(
fmt
.
i_extra
);
if
(
!
fmt
.
p_extra
)
{
free
(
p_sys
->
pi_seektable
);
free
(
p_seektable
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
memcpy
(
(
uint8_t
*
)
fmt
.
p_extra
,
p_header
,
22
);
memcpy
(
(
uint8_t
*
)
fmt
.
p_extra
+
22
,
p_seektable
,
fmt
.
i_extra
-
22
);
...
...
@@ -154,6 +175,7 @@ static void Close( vlc_object_t * p_this )
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
free
(
p_sys
->
pi_seektable
);
free
(
p_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