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
b395fd3d
Commit
b395fd3d
authored
Jun 12, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/jpeg2000dec: add some sanity checking on newpasses
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5ccca4eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
jpeg2000.h
libavcodec/jpeg2000.h
+2
-0
jpeg2000dec.c
libavcodec/jpeg2000dec.c
+5
-0
No files found.
libavcodec/jpeg2000.h
View file @
b395fd3d
...
...
@@ -71,6 +71,8 @@ enum Jpeg2000Quantsty { // quantization style
#define JPEG2000_MAX_DECLEVELS 32
#define JPEG2000_MAX_RESLEVELS (JPEG2000_MAX_DECLEVELS + 1)
#define JPEG2000_MAX_PASSES 100
// T1 flags
// flags determining significance of neighbor coefficients
#define JPEG2000_T1_SIG_N 0x0001
...
...
libavcodec/jpeg2000dec.c
View file @
b395fd3d
...
...
@@ -805,6 +805,11 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
}
if
((
newpasses
=
getnpasses
(
s
))
<
0
)
return
newpasses
;
av_assert2
(
newpasses
>
0
);
if
(
cblk
->
npasses
+
newpasses
>=
JPEG2000_MAX_PASSES
)
{
avpriv_request_sample
(
s
->
avctx
,
"Too many passes
\n
"
);
return
AVERROR_PATCHWELCOME
;
}
if
((
llen
=
getlblockinc
(
s
))
<
0
)
return
llen
;
if
(
cblk
->
lblock
+
llen
+
av_log2
(
newpasses
)
>
16
)
{
...
...
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