"Fossies" - the Fresh Open Source Software Archive

Member "texmaker-5.0.4/pdfium/third_party/libopenjpeg20/0006-tcd_init_tile.patch" (16 Apr 2017, 902 Bytes) of package /linux/misc/texmaker-5.0.4.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 diff --git a/third_party/libopenjpeg20/tcd.c b/third_party/libopenjpeg20/tcd.c
    2 index 2fccff1..aebe9be 100644
    3 --- a/third_party/libopenjpeg20/tcd.c
    4 +++ b/third_party/libopenjpeg20/tcd.c
    5 @@ -727,7 +727,10 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
    6         l_tilec->x1 = opj_int_ceildiv(l_tile->x1, (OPJ_INT32)l_image_comp->dx);
    7         l_tilec->y1 = opj_int_ceildiv(l_tile->y1, (OPJ_INT32)l_image_comp->dy);
    8         /*fprintf(stderr, "\tTile compo border = %d,%d,%d,%d\n", l_tilec->x0, l_tilec->y0,l_tilec->x1,l_tilec->y1);*/
    9 -       
   10 +       if (l_tilec->x0 >= l_tilec->x1 || l_tilec->y0 >= l_tilec->y1) {
   11 +           opj_event_msg(manager, EVT_ERROR, "Invalid tile data\n");
   12 +           return OPJ_FALSE;
   13 +       }
   14         /* compute l_data_size with overflow check */
   15         l_data_size = (OPJ_UINT32)(l_tilec->x1 - l_tilec->x0);
   16         if ((((OPJ_UINT32)-1) / l_data_size) < (OPJ_UINT32)(l_tilec->y1 - l_tilec->y0)) {