Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c780b543
Commit
c780b543
authored
Oct 07, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
id3v2: fix NULL pointer dereference
Bug found by Laurent Aimar fenrir at videolan org
parent
2804d320
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
id3v2.c
libavformat/id3v2.c
+6
-6
No files found.
libavformat/id3v2.c
View file @
c780b543
...
...
@@ -351,7 +351,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
AVIOContext
*
pbx
;
unsigned
char
*
buffer
=
NULL
;
int
buffer_size
=
0
;
void
(
*
extra_func
)(
AVFormatContext
*
,
AVIOContext
*
,
int
,
char
*
,
ID3v2ExtraMeta
**
)
=
NULL
;
const
ID3v2EMFunc
*
extra_func
;
switch
(
version
)
{
case
2
:
...
...
@@ -419,7 +419,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
av_log
(
s
,
AV_LOG_WARNING
,
"Skipping encrypted/compressed ID3v2 frame %s.
\n
"
,
tag
);
avio_skip
(
s
->
pb
,
tlen
);
/* check for text tag or supported special meta tag */
}
else
if
(
tag
[
0
]
==
'T'
||
(
extra_meta
&&
(
extra_func
=
get_extra_meta_func
(
tag
,
isv34
)
->
read
)))
{
}
else
if
(
tag
[
0
]
==
'T'
||
(
extra_meta
&&
(
extra_func
=
get_extra_meta_func
(
tag
,
isv34
))))
{
if
(
unsync
||
tunsync
)
{
int
i
,
j
;
av_fast_malloc
(
&
buffer
,
&
buffer_size
,
tlen
);
...
...
@@ -445,7 +445,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
read_ttag
(
s
,
pbx
,
tlen
,
tag
);
else
/* parse special meta tag */
extra_func
(
s
,
pbx
,
tlen
,
tag
,
extra_meta
);
extra_func
->
read
(
s
,
pbx
,
tlen
,
tag
,
extra_meta
);
}
else
if
(
!
tag
[
0
])
{
if
(
tag
[
1
])
...
...
@@ -508,11 +508,11 @@ void ff_id3v2_read(AVFormatContext *s, const char *magic)
void
ff_id3v2_free_extra_meta
(
ID3v2ExtraMeta
**
extra_meta
)
{
ID3v2ExtraMeta
*
current
=
*
extra_meta
,
*
next
;
void
(
*
free_func
)(
ID3v2ExtraMeta
*
)
;
const
ID3v2EMFunc
*
extra_func
;
while
(
current
)
{
if
((
free_func
=
get_extra_meta_func
(
current
->
tag
,
1
)
->
free
))
free_func
(
current
->
data
);
if
((
extra_func
=
get_extra_meta_func
(
current
->
tag
,
1
)
))
extra_func
->
free
(
current
->
data
);
next
=
current
->
next
;
av_freep
(
&
current
);
current
=
next
;
...
...
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