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
493aa30a
Commit
493aa30a
authored
Feb 09, 2011
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvbsubdec: check against buffer overreads
Signed-off-by:
Janne Grunau
<
janne-ffmpeg@jannau.net
>
parent
4a72765a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
dvbsubdec.c
libavcodec/dvbsubdec.c
+9
-2
No files found.
libavcodec/dvbsubdec.c
View file @
493aa30a
...
...
@@ -1423,13 +1423,15 @@ static int dvbsub_decode(AVCodecContext *avctx,
#endif
if
(
buf_size
<=
2
||
*
buf
!=
0x0f
)
if
(
buf_size
<=
6
||
*
buf
!=
0x0f
)
{
av_dlog
(
avctx
,
"incomplete or broken packet"
);
return
-
1
;
}
p
=
buf
;
p_end
=
buf
+
buf_size
;
while
(
p
<
p_end
&&
*
p
==
0x0f
)
{
while
(
p
_end
-
p
>=
6
&&
*
p
==
0x0f
)
{
p
+=
1
;
segment_type
=
*
p
++
;
page_id
=
AV_RB16
(
p
);
...
...
@@ -1437,6 +1439,11 @@ static int dvbsub_decode(AVCodecContext *avctx,
segment_length
=
AV_RB16
(
p
);
p
+=
2
;
if
(
p_end
-
p
<
segment_length
)
{
av_dlog
(
avctx
,
"incomplete or broken packet"
);
return
-
1
;
}
if
(
page_id
==
ctx
->
composition_id
||
page_id
==
ctx
->
ancillary_id
||
ctx
->
composition_id
==
-
1
||
ctx
->
ancillary_id
==
-
1
)
{
switch
(
segment_type
)
{
...
...
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