diff options
| author | Giuseppe Baruffa <gbaruffa@users.noreply.github.com> | 2007-03-27 17:18:56 +0000 |
|---|---|---|
| committer | Giuseppe Baruffa <gbaruffa@users.noreply.github.com> | 2007-03-27 17:18:56 +0000 |
| commit | 144e1ff4e6b2105c3ab5023d90a487509ee3bc02 (patch) | |
| tree | 21a71346672fda1b877a8733bd43cb5f2db30ebb /libopenjpeg/t2.c | |
| parent | 3f36196dfdd740417d5dfd7d7d313dd179d4a304 (diff) | |
Following to Hervé's suggestions, all the exit() calls, added by JPWL strict checking in t2.c and j2k.c, have been substituted with (object free'ing + opj_evt_message(EVT_ERROR) + return); added linking to TIFF library in the JPWL VC6 workspaces
Diffstat (limited to 'libopenjpeg/t2.c')
| -rw-r--r-- | libopenjpeg/t2.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libopenjpeg/t2.c b/libopenjpeg/t2.c index 3e6f0e7b..03f6933d 100644 --- a/libopenjpeg/t2.c +++ b/libopenjpeg/t2.c @@ -521,24 +521,25 @@ static int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_t return -999; } -/* UniPG>> */ #ifdef USE_JPWL /* we need here a j2k handle to verify if making a check to the validity of cblocks parameters is selected from user (-W) */ /* let's check that we are not exceeding */ if ((cblk->len + seg->newlen) > 8192) { - fprintf(stderr, "JPWL: segment too long (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n", + opj_event_msg(t2->cinfo, EVT_WARNING, + "JPWL: segment too long (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n", seg->newlen, cblkno, precno, bandno, resno, compno); - if (!JPWL_ASSUME) - exit(-1); + if (!JPWL_ASSUME) { + opj_event_msg(t2->cinfo, EVT_ERROR, "JPWL: giving up\n"); + return -999; + } seg->newlen = 8192 - cblk->len; - fprintf(stderr, " - truncating segment to %d\n", seg->newlen); + opj_event_msg(t2->cinfo, EVT_WARNING, " - truncating segment to %d\n", seg->newlen); break; }; #endif /* USE_JPWL */ -/* <<UniPG */ memcpy(cblk->data + cblk->len, c, seg->newlen); if (seg->numpasses == 0) { |
