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

Side by Side Diff: third_party/libopenjpeg20/0008-jp2_check_color.patch

Issue 1548583002: Replace an assertion with returning false (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Shorten the description in README.pdfium Created 4 years, 12 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/jp2.c b/third_party/libopenjpeg20/jp2.c
2 index f3baca5..3bcb42e 100644
3 --- a/third_party/libopenjpeg20/jp2.c
4 +++ b/third_party/libopenjpeg20/jp2.c
5 @@ -896,8 +896,12 @@ static OPJ_BOOL opj_jp2_check_color(opj_image_t *image, opj _jp2_color_t *color,
6 }
7 /* verify that no component is targeted more than once */
8 for (i = 0; i < nr_channels; i++) {
9 - OPJ_UINT16 pcol = cmap[i].pcol;
10 - assert(cmap[i].mtyp == 0 || cmap[i].mtyp == 1);
11 + if (cmap[i].mtyp != 0 && cmap[i].mtyp != 1) {
12 + opj_event_msg(p_manager, EVT_ERROR, "Unexpected MTYP value.\n");
13 + opj_free(pcol_usage);
14 + return OPJ_FALSE;
15 + }
16 + OPJ_UINT16 pcol = cmap[i].pcol;
17 if (pcol >= nr_channels) {
18 opj_event_msg(p_manager, EVT_ERROR, "Invalid com ponent/palette index for direct mapping %d.\n", pcol);
19 is_sane = OPJ_FALSE;
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