OLD | NEW |
(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; |
OLD | NEW |