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
d3cb302b
Commit
d3cb302b
authored
Jul 01, 2013
by
Michael Niedermayer
Committed by
Luca Barbato
Jul 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jpeg2000: Validate SOT parsing
Avoid some overreads. Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
1a3598aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
jpeg2000dec.c
libavcodec/jpeg2000dec.c
+13
-0
No files found.
libavcodec/jpeg2000dec.c
View file @
d3cb302b
...
...
@@ -423,6 +423,9 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
return
AVERROR_INVALIDDATA
;
Isot
=
bytestream2_get_be16u
(
&
s
->
g
);
// Isot
if
(
Isot
>=
s
->
numXtiles
*
s
->
numYtiles
)
return
AVERROR_INVALIDDATA
;
if
(
Isot
)
{
avpriv_request_sample
(
s
->
avctx
,
"Support for more than one tile"
);
return
AVERROR_PATCHWELCOME
;
...
...
@@ -433,6 +436,16 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
/* Read TNSot but not used */
bytestream2_get_byteu
(
&
s
->
g
);
// TNsot
if
(
Psot
>
bytestream2_get_bytes_left
(
&
s
->
g
)
+
n
+
2
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Psot %d too big
\n
"
,
Psot
);
return
AVERROR_INVALIDDATA
;
}
if
(
TPsot
>=
FF_ARRAY_ELEMS
(
s
->
tile
[
Isot
].
tile_part
))
{
avpriv_request_sample
(
s
->
avctx
,
"Support for %d components"
,
TPsot
);
return
AVERROR_PATCHWELCOME
;
}
tp
=
s
->
tile
[
s
->
curtileno
].
tile_part
+
TPsot
;
tp
->
tile_index
=
Isot
;
tp
->
tp_len
=
Psot
;
...
...
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