Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/libopenjpeg20/0011-j2k_update_image_data.patch

Issue 1756483002: Merge to M49: openjpeg: Prevent bad cast in opj_j2k_update_image_data (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@2623
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/libopenjpeg20/README.pdfium » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 diff --git a/third_party/libopenjpeg20/j2k.c b/third_party/libopenjpeg20/j2k.c
2 index b20f219..9056feb 100644
3 --- a/third_party/libopenjpeg20/j2k.c
4 +++ b/third_party/libopenjpeg20/j2k.c
5 @@ -8211,6 +8211,12 @@ static OPJ_BOOL opj_j2k_update_image_data (opj_tcd_t * p_ tcd, OPJ_BYTE * p_data,
6 * */
7 assert( l_res->x0 >= 0);
8 assert( l_res->x1 >= 0);
9 +
10 + /* Prevent bad casting to unsigned values in the subsequent lin es. */
11 + if ( l_res->x0 < 0 || l_res->x1 < 0 || l_res->y0 < 0 || l_res-> y1 < 0 ) {
12 + return OPJ_FALSE;
13 + }
14 +
15 if ( l_x0_dest < (OPJ_UINT32)l_res->x0 ) {
16 l_start_x_dest = (OPJ_UINT32)l_res->x0 - l_x0_dest;
17 l_offset_x0_src = 0;
OLDNEW
« no previous file with comments | « no previous file | third_party/libopenjpeg20/README.pdfium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698