Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
9765549f
Commit
9765549f
authored
9 years ago
by
Luca Barbato
Browse files
Options
Downloads
Patches
Plain Diff
mpegts: Forward the errors on mpeg4 objects parsing
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
07a844f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/mpegts.c
+16
-9
16 additions, 9 deletions
libavformat/mpegts.c
with
16 additions
and
9 deletions
libavformat/mpegts.c
+
16
−
9
View file @
9765549f
...
@@ -1112,6 +1112,8 @@ static int parse_MP4ODescrTag(MP4DescrParseContext *d, int64_t off, int len)
...
@@ -1112,6 +1112,8 @@ static int parse_MP4ODescrTag(MP4DescrParseContext *d, int64_t off, int len)
static
int
parse_MP4ESDescrTag
(
MP4DescrParseContext
*
d
,
int64_t
off
,
int
len
)
static
int
parse_MP4ESDescrTag
(
MP4DescrParseContext
*
d
,
int64_t
off
,
int
len
)
{
{
int
es_id
=
0
;
int
es_id
=
0
;
int
ret
=
0
;
if
(
d
->
descr_count
>=
d
->
max_descr_count
)
if
(
d
->
descr_count
>=
d
->
max_descr_count
)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
ff_mp4_parse_es_descr
(
&
d
->
pb
,
&
es_id
);
ff_mp4_parse_es_descr
(
&
d
->
pb
,
&
es_id
);
...
@@ -1119,12 +1121,13 @@ static int parse_MP4ESDescrTag(MP4DescrParseContext *d, int64_t off, int len)
...
@@ -1119,12 +1121,13 @@ static int parse_MP4ESDescrTag(MP4DescrParseContext *d, int64_t off, int len)
d
->
active_descr
->
es_id
=
es_id
;
d
->
active_descr
->
es_id
=
es_id
;
update_offsets
(
&
d
->
pb
,
&
off
,
&
len
);
update_offsets
(
&
d
->
pb
,
&
off
,
&
len
);
parse_mp4_descr
(
d
,
off
,
len
,
MP4DecConfigDescrTag
);
if
((
ret
=
parse_mp4_descr
(
d
,
off
,
len
,
MP4DecConfigDescrTag
))
<
0
)
return
ret
;
update_offsets
(
&
d
->
pb
,
&
off
,
&
len
);
update_offsets
(
&
d
->
pb
,
&
off
,
&
len
);
if
(
len
>
0
)
if
(
len
>
0
)
parse_mp4_descr
(
d
,
off
,
len
,
MP4SLDescrTag
);
ret
=
parse_mp4_descr
(
d
,
off
,
len
,
MP4SLDescrTag
);
d
->
active_descr
=
NULL
;
d
->
active_descr
=
NULL
;
return
0
;
return
ret
;
}
}
static
int
parse_MP4DecConfigDescrTag
(
MP4DescrParseContext
*
d
,
int64_t
off
,
static
int
parse_MP4DecConfigDescrTag
(
MP4DescrParseContext
*
d
,
int64_t
off
,
...
@@ -1179,6 +1182,8 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
...
@@ -1179,6 +1182,8 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
{
{
int
tag
;
int
tag
;
int
len1
=
ff_mp4_read_descr
(
d
->
s
,
&
d
->
pb
,
&
tag
);
int
len1
=
ff_mp4_read_descr
(
d
->
s
,
&
d
->
pb
,
&
tag
);
int
ret
=
0
;
update_offsets
(
&
d
->
pb
,
&
off
,
&
len
);
update_offsets
(
&
d
->
pb
,
&
off
,
&
len
);
if
(
len
<
0
||
len1
>
len
||
len1
<=
0
)
{
if
(
len
<
0
||
len1
>
len
||
len1
<=
0
)
{
av_log
(
d
->
s
,
AV_LOG_ERROR
,
av_log
(
d
->
s
,
AV_LOG_ERROR
,
...
@@ -1189,30 +1194,32 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
...
@@ -1189,30 +1194,32 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
if
(
d
->
level
++
>=
MAX_LEVEL
)
{
if
(
d
->
level
++
>=
MAX_LEVEL
)
{
av_log
(
d
->
s
,
AV_LOG_ERROR
,
"Maximum MP4 descriptor level exceeded
\n
"
);
av_log
(
d
->
s
,
AV_LOG_ERROR
,
"Maximum MP4 descriptor level exceeded
\n
"
);
ret
=
AVERROR_INVALIDDATA
;
goto
done
;
goto
done
;
}
}
if
(
target_tag
&&
tag
!=
target_tag
)
{
if
(
target_tag
&&
tag
!=
target_tag
)
{
av_log
(
d
->
s
,
AV_LOG_ERROR
,
"Found tag %x expected %x
\n
"
,
tag
,
av_log
(
d
->
s
,
AV_LOG_ERROR
,
"Found tag %x expected %x
\n
"
,
tag
,
target_tag
);
target_tag
);
ret
=
AVERROR_INVALIDDATA
;
goto
done
;
goto
done
;
}
}
switch
(
tag
)
{
switch
(
tag
)
{
case
MP4IODescrTag
:
case
MP4IODescrTag
:
parse_MP4IODescrTag
(
d
,
off
,
len1
);
ret
=
parse_MP4IODescrTag
(
d
,
off
,
len1
);
break
;
break
;
case
MP4ODescrTag
:
case
MP4ODescrTag
:
parse_MP4ODescrTag
(
d
,
off
,
len1
);
ret
=
parse_MP4ODescrTag
(
d
,
off
,
len1
);
break
;
break
;
case
MP4ESDescrTag
:
case
MP4ESDescrTag
:
parse_MP4ESDescrTag
(
d
,
off
,
len1
);
ret
=
parse_MP4ESDescrTag
(
d
,
off
,
len1
);
break
;
break
;
case
MP4DecConfigDescrTag
:
case
MP4DecConfigDescrTag
:
parse_MP4DecConfigDescrTag
(
d
,
off
,
len1
);
ret
=
parse_MP4DecConfigDescrTag
(
d
,
off
,
len1
);
break
;
break
;
case
MP4SLDescrTag
:
case
MP4SLDescrTag
:
parse_MP4SLDescrTag
(
d
,
off
,
len1
);
ret
=
parse_MP4SLDescrTag
(
d
,
off
,
len1
);
break
;
break
;
}
}
...
@@ -1220,7 +1227,7 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
...
@@ -1220,7 +1227,7 @@ static int parse_mp4_descr(MP4DescrParseContext *d, int64_t off, int len,
done:
done:
d
->
level
--
;
d
->
level
--
;
avio_seek
(
&
d
->
pb
,
off
+
len1
,
SEEK_SET
);
avio_seek
(
&
d
->
pb
,
off
+
len1
,
SEEK_SET
);
return
0
;
return
ret
;
}
}
static
int
mp4_read_iods
(
AVFormatContext
*
s
,
const
uint8_t
*
buf
,
unsigned
size
,
static
int
mp4_read_iods
(
AVFormatContext
*
s
,
const
uint8_t
*
buf
,
unsigned
size
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment