Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
a572cc8c
Commit
a572cc8c
authored
Jan 07, 2013
by
Peter Ross
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtvdec: prevent memory leak in get_tag()
parent
7fb87bc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
wtvdec.c
libavformat/wtvdec.c
+10
-5
No files found.
libavformat/wtvdec.c
View file @
a572cc8c
...
@@ -448,15 +448,20 @@ done:
...
@@ -448,15 +448,20 @@ done:
static
void
get_tag
(
AVFormatContext
*
s
,
AVIOContext
*
pb
,
const
char
*
key
,
int
type
,
int
length
)
static
void
get_tag
(
AVFormatContext
*
s
,
AVIOContext
*
pb
,
const
char
*
key
,
int
type
,
int
length
)
{
{
int
buf_size
=
FFMAX
(
2
*
length
,
LEN_PRETTY_GUID
)
+
1
;
int
buf_size
;
char
*
buf
=
av_malloc
(
buf_size
);
char
*
buf
;
if
(
!
buf
)
return
;
if
(
!
strcmp
(
key
,
"WM/MediaThumbType"
))
{
if
(
!
strcmp
(
key
,
"WM/MediaThumbType"
))
{
avio_skip
(
pb
,
length
);
avio_skip
(
pb
,
length
);
return
;
return
;
}
else
if
(
type
==
0
&&
length
==
4
)
{
}
buf_size
=
FFMAX
(
2
*
length
,
LEN_PRETTY_GUID
)
+
1
;
buf
=
av_malloc
(
buf_size
);
if
(
!
buf
)
return
;
if
(
type
==
0
&&
length
==
4
)
{
snprintf
(
buf
,
buf_size
,
"%"
PRIi32
,
avio_rl32
(
pb
));
snprintf
(
buf
,
buf_size
,
"%"
PRIi32
,
avio_rl32
(
pb
));
}
else
if
(
type
==
1
)
{
}
else
if
(
type
==
1
)
{
avio_get_str16le
(
pb
,
length
,
buf
,
buf_size
);
avio_get_str16le
(
pb
,
length
,
buf
,
buf_size
);
...
...
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