Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More overflow related bug fixes #1402

Merged
merged 51 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
33c2d33
Added multiplication check to calloc calls in opj_compress, opj_decom…
Eharve14 Jan 13, 2022
d564919
Added multiplication check for calloc calls, see comment on commit 79…
Eharve14 Jan 13, 2022
c261172
Delete settings.json
Eharve14 Jan 13, 2022
fc2d47a
Fixed typo
Eharve14 Jan 13, 2022
85b471f
Merge branch 'master' of https://github.com/Eharve14/openjpeg
Eharve14 Jan 13, 2022
e74ee84
Revised to address int overflow in for loop only
Eharve14 Jan 13, 2022
d8fe126
Revert "Revised to address int overflow in for loop only"
Eharve14 Jan 13, 2022
968cf54
Revised to catch negitive values of num_images
Eharve14 Jan 13, 2022
efa9c7e
Revised to casts, deleted all other changes
Eharve14 Jan 13, 2022
98f4ace
style updates
Eharve14 Jan 13, 2022
a0b7102
Style part two
Eharve14 Jan 13, 2022
3058194
I am bad and I feel bad, I should have just used the scrypt
Eharve14 Jan 13, 2022
7c42257
Why, why is this happening
Eharve14 Jan 13, 2022
323a089
Update src/bin/jp2/opj_dump.c
rouault Jan 13, 2022
e27cfb3
Update src/bin/jp2/opj_dump.c
rouault Jan 13, 2022
ab6c7c7
Added overflow check to get_num_images, defined num_images as unsigne…
Eharve14 Jan 13, 2022
dbe64d6
Fixed style
Eharve14 Jan 13, 2022
957a6cd
Revert "Fixed style"
Eharve14 Jan 13, 2022
cbc8b26
Revert "Added overflow check to get_num_images, defined num_images as…
Eharve14 Jan 13, 2022
3882583
Merge pull request #1 from uclouvain/master
Eharve14 Jan 13, 2022
912a144
Fixed issues with get_num_images, moved the zero file check to preven…
Eharve14 Jan 13, 2022
96c6587
Same as last
Eharve14 Jan 13, 2022
21ac2bb
Merge branch 'master' of https://github.com/Eharve14/openjpeg
Eharve14 Jan 13, 2022
081bc3e
Fixed style
Eharve14 Jan 13, 2022
e011787
Added import of limits.h, revised overflow check, Redefined Return va…
Eharve14 Jan 14, 2022
7766d9c
Added return statement to break iteration
Eharve14 Jan 15, 2022
67536c7
Style fix
Eharve14 Jan 15, 2022
43bf2be
Re-Revised to use break statement instead of return.
Eharve14 Jan 15, 2022
d2bffdf
Merge branch 'uclouvain:master' into master
Eharve14 Jan 15, 2022
3a71edf
TEst
Eharve14 Jan 15, 2022
26a5626
Set number of jobs to rh.
Eharve14 Jan 15, 2022
998366b
Style fix, deleted whitespace.
Eharve14 Jan 15, 2022
76d50ce
Corrected type for num_images in main, was singed integer
Eharve14 Jan 16, 2022
8f5f221
Delete dwt.c
Eharve14 Jan 16, 2022
a46ab03
Revert "Style fix, deleted whitespace."
Eharve14 Jan 16, 2022
79e4133
Revert "Set number of jobs to rh."
Eharve14 Jan 16, 2022
56f9a7e
Revert "TEst"
Eharve14 Jan 16, 2022
7e3b389
Merge branch 'master' of https://github.com/Eharve14/openjpeg
Eharve14 Jan 16, 2022
54a80d7
Reviesed to keep int type for other variables
Eharve14 Jan 16, 2022
fc88a30
same as last
Eharve14 Jan 16, 2022
85b248b
Resloved issue where imagino used to iterate through files retrived w…
Eharve14 Jan 16, 2022
1dbc41a
fixed iterator issue in for loop to set up dirptr
Eharve14 Jan 16, 2022
8bb3ea7
Stylefix
Eharve14 Jan 16, 2022
2947bf2
Fixed signed issues in print statements, correced addtional signed is…
Eharve14 Jan 16, 2022
c0ba980
Style fix
Eharve14 Jan 16, 2022
c4bbb4e
Merge branch 'uclouvain:master' into master
Eharve14 Jan 16, 2022
cc635ec
Merge branch 'uclouvain:master' into master
Eharve14 Jan 18, 2022
8f5d7dd
Revised iterator type in jp2.c, added cast to to memory allocation to…
Eharve14 Jan 18, 2022
122093b
Added type casts to prevent unitended overflow.
Eharve14 Jan 18, 2022
31445c5
added casts to prevent unitended overflows
Eharve14 Jan 18, 2022
1d3cade
Merge pull request #3 from Eharve14/Security-Fixes-related-to-integer…
Eharve14 Jan 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ static OPJ_BOOL opj_j2k_check_poc_val(const opj_poc_t *p_pocs,

assert(p_nb_pocs > 0);

packet_array = (OPJ_UINT32*) opj_calloc(step_l * p_num_layers,
packet_array = (OPJ_UINT32*) opj_calloc((size_t)step_l * p_num_layers,
sizeof(OPJ_UINT32));
if (packet_array == 00) {
opj_event_msg(p_manager, EVT_ERROR,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/openjp2/jp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,9 @@ static OPJ_BOOL opj_jp2_apply_pclr(opj_image_t *image,
}

max = image->numcomps;
for (i = 0; i < max; ++i) {
if (old_comps[i].data) {
opj_image_data_free(old_comps[i].data);
for (j = 0; j < max; ++j) {
if (old_comps[j].data) {
opj_image_data_free(old_comps[j].data);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjp2/mct.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ void opj_calculate_norms(OPJ_FLOAT64 * pNorms,
for (j = 0; j < pNbComps; ++j) {
lCurrentValue = lMatrix[lIndex];
lIndex += pNbComps;
lNorms[i] += lCurrentValue * lCurrentValue;
lNorms[i] += (OPJ_FLOAT64) lCurrentValue * lCurrentValue;
}
lNorms[i] = sqrt(lNorms[i]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/openjp2/sparse_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ opj_sparse_array_int32_t* opj_sparse_array_int32_create(OPJ_UINT32 width,
return NULL;
}
sa->data_blocks = (OPJ_INT32**) opj_calloc(sizeof(OPJ_INT32*),
sa->block_count_hor * sa->block_count_ver);
(size_t) sa->block_count_hor * sa->block_count_ver);
if (sa->data_blocks == NULL) {
opj_free(sa);
return NULL;
Expand Down Expand Up @@ -235,7 +235,7 @@ static OPJ_BOOL opj_sparse_array_int32_read_or_write(
} else {
if (src_block == NULL) {
src_block = (OPJ_INT32*) opj_calloc(1,
sa->block_width * sa->block_height * sizeof(OPJ_INT32));
(size_t) sa->block_width * sa->block_height * sizeof(OPJ_INT32));
if (src_block == NULL) {
return OPJ_FALSE;
}
Expand Down