Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
L
libtiff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
libtiff
libtiff
Commits
9171da59
Commit
9171da59
authored
7 years ago
by
Nathan Baker
Committed by
Olivier Paquet
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add workaround to pal2rgb buffer overflow.
parent
070abb3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/pal2rgb.c
+15
-2
15 additions, 2 deletions
tools/pal2rgb.c
with
15 additions
and
2 deletions
tools/pal2rgb.c
+
15
−
2
View file @
9171da59
...
...
@@ -182,8 +182,21 @@ main(int argc, char* argv[])
{
unsigned
char
*
ibuf
,
*
obuf
;
register
unsigned
char
*
pp
;
register
uint32
x
;
ibuf
=
(
unsigned
char
*
)
_TIFFmalloc
(
TIFFScanlineSize
(
in
));
obuf
=
(
unsigned
char
*
)
_TIFFmalloc
(
TIFFScanlineSize
(
out
));
tmsize_t
tss_in
=
TIFFScanlineSize
(
in
);
tmsize_t
tss_out
=
TIFFScanlineSize
(
out
);
if
(
tss_out
/
tss_in
<
3
)
{
/*
* BUG 2750: The following code does not know about chroma
* subsampling of JPEG data. It assumes that the output buffer is 3x
* the length of the input buffer due to exploding the palette into
* RGB tuples. If this assumption is incorrect, it could lead to a
* buffer overflow. Go ahead and fail now to prevent that.
*/
fprintf
(
stderr
,
"Could not determine correct image size for output. Exiting.
\n
"
);
return
-
1
;
}
ibuf
=
(
unsigned
char
*
)
_TIFFmalloc
(
tss_in
);
obuf
=
(
unsigned
char
*
)
_TIFFmalloc
(
tss_out
);
switch
(
config
)
{
case
PLANARCONFIG_CONTIG
:
for
(
row
=
0
;
row
<
imagelength
;
row
++
)
{
...
...
This diff is collapsed.
Click to expand it.
Thomas Bernard
@miniupnp
mentioned in issue
#111 (closed)
·
5 years ago
mentioned in issue
#111 (closed)
mentioned in issue #111
Toggle commit list
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