X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=otherlibs%2F_graphics%2Fsrc%2Flibjasper%2Fjpc_cs.c;h=d1859142e17a0661856b029181e6185c11c5d017;hb=80cd7b93506cc1926882d5fd08a2c74ee9359e29;hp=1b4174e9f1ec676ddabf688a883eeb8b662e24c7;hpb=467a270adf12425827305759c0c4ea8f5b2b3854;p=opencv diff --git a/otherlibs/_graphics/src/libjasper/jpc_cs.c b/otherlibs/_graphics/src/libjasper/jpc_cs.c index 1b4174e..d185914 100644 --- a/otherlibs/_graphics/src/libjasper/jpc_cs.c +++ b/otherlibs/_graphics/src/libjasper/jpc_cs.c @@ -9,9 +9,9 @@ * * JasPer License Version 2.0 * + * Copyright (c) 2001-2006 Michael David Adams * Copyright (c) 1999-2000 Image Power, Inc. * Copyright (c) 1999-2000 The University of British Columbia - * Copyright (c) 2001-2003 Michael David Adams * * All rights reserved. * @@ -64,7 +64,7 @@ /* * JPEG-2000 Code Stream Library * - * $Id: jpc_cs.c,v 1.1 2007/01/15 16:09:24 vp153 Exp $ + * $Id: jpc_cs.c,v 1.2 2008/05/26 09:40:52 vp153 Exp $ */ /******************************************************************************\ @@ -289,8 +289,7 @@ jpc_ms_t *jpc_getms(jas_stream_t *in, jpc_cstate_t *cstate) } if (JAS_CAST(ulong, jas_stream_tell(tmpstream)) != ms->len) { - fprintf(stderr, - "warning: trailing garbage in marker segment (%ld bytes)\n", + jas_eprintf("warning: trailing garbage in marker segment (%ld bytes)\n", ms->len - jas_stream_tell(tmpstream)); } @@ -639,7 +638,7 @@ static int jpc_cod_dumpparms(jpc_ms_t *ms, FILE *out) cod->compparms.cblksty); if (cod->csty & JPC_COX_PRT) { for (i = 0; i < cod->compparms.numrlvls; ++i) { - fprintf(stderr, "prcwidth[%d] = %d, prcheight[%d] = %d\n", + jas_eprintf("prcwidth[%d] = %d, prcheight[%d] = %d\n", i, cod->compparms.rlvls[i].parwidthval, i, cod->compparms.rlvls[i].parheightval); } @@ -983,21 +982,21 @@ static int jpc_qcx_getcompparms(jpc_qcxcp_t *compparms, jpc_cstate_t *cstate, compparms->numstepsizes = (len - n) / 2; break; } -if (compparms->numstepsizes > 0) { - compparms->stepsizes = jas_malloc(compparms->numstepsizes * - sizeof(uint_fast32_t)); - assert(compparms->stepsizes); - for (i = 0; i < compparms->numstepsizes; ++i) { - if (compparms->qntsty == JPC_QCX_NOQNT) { - jpc_getuint8(in, &tmp); - compparms->stepsizes[i] = JPC_QCX_EXPN(tmp >> 3); - } else { - jpc_getuint16(in, &compparms->stepsizes[i]); + if (compparms->numstepsizes > 0) { + compparms->stepsizes = jas_malloc(compparms->numstepsizes * + sizeof(uint_fast16_t)); + assert(compparms->stepsizes); + for (i = 0; i < compparms->numstepsizes; ++i) { + if (compparms->qntsty == JPC_QCX_NOQNT) { + jpc_getuint8(in, &tmp); + compparms->stepsizes[i] = JPC_QCX_EXPN(tmp >> 3); + } else { + jpc_getuint16(in, &compparms->stepsizes[i]); + } } + } else { + compparms->stepsizes = 0; } -} else { - compparms->stepsizes = 0; -} if (jas_stream_error(in) || jas_stream_eof(in)) { jpc_qcx_destroycompparms(compparms); return -1;