diff options
-rw-r--r-- | jbig2_image.c | 2 | ||||
-rw-r--r-- | jbig2_symbol_dict.c | 12 | ||||
-rw-r--r-- | jbig2_text.c | 8 |
3 files changed, 15 insertions, 7 deletions
diff --git a/jbig2_image.c b/jbig2_image.c index a0be5a160..c787c929d 100644 --- a/jbig2_image.c +++ b/jbig2_image.c | |||
@@ -55,7 +55,7 @@ Jbig2Image* jbig2_image_new(Jbig2Ctx *ctx, int width, int height) | |||
55 | image->data = jbig2_new(ctx, uint8_t, (int)check); | 55 | image->data = jbig2_new(ctx, uint8_t, (int)check); |
56 | if (image->data == NULL) { | 56 | if (image->data == NULL) { |
57 | jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1, | 57 | jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1, |
58 | "could not allocate image data buffer! [%d bytes]\n", stride*height); | 58 | "could not allocate image data buffer! [%d bytes]", stride*height); |
59 | jbig2_free(ctx->allocator, image); | 59 | jbig2_free(ctx->allocator, image); |
60 | return NULL; | 60 | return NULL; |
61 | } | 61 | } |
diff --git a/jbig2_symbol_dict.c b/jbig2_symbol_dict.c index 9440db32b..16a034424 100644 --- a/jbig2_symbol_dict.c +++ b/jbig2_symbol_dict.c | |||
@@ -230,7 +230,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx, | |||
230 | Jbig2SymbolDict *SDEXSYMS = NULL; | 230 | Jbig2SymbolDict *SDEXSYMS = NULL; |
231 | int32_t HCHEIGHT; | 231 | int32_t HCHEIGHT; |
232 | uint32_t NSYMSDECODED; | 232 | uint32_t NSYMSDECODED; |
233 | int32_t SYMWIDTH, TOTWIDTH; | 233 | uint32_t SYMWIDTH, TOTWIDTH; |
234 | uint32_t HCFIRSTSYM; | 234 | uint32_t HCFIRSTSYM; |
235 | uint32_t *SDNEWSYMWIDTHS = NULL; | 235 | uint32_t *SDNEWSYMWIDTHS = NULL; |
236 | int SBSYMCODELEN = 0; | 236 | int SBSYMCODELEN = 0; |
@@ -285,7 +285,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx, | |||
285 | goto cleanup1; | 285 | goto cleanup1; |
286 | } | 286 | } |
287 | if (params->SDREFAGG) { | 287 | if (params->SDREFAGG) { |
288 | int tmp = params->SDINSYMS->n_symbols + params->SDNUMNEWSYMS; | 288 | int tmp = params->SDNUMINSYMS + params->SDNUMNEWSYMS; |
289 | for (SBSYMCODELEN = 0; (1 << SBSYMCODELEN) < tmp; SBSYMCODELEN++); | 289 | for (SBSYMCODELEN = 0; (1 << SBSYMCODELEN) < tmp; SBSYMCODELEN++); |
290 | IAID = jbig2_arith_iaid_ctx_new(ctx, SBSYMCODELEN); | 290 | IAID = jbig2_arith_iaid_ctx_new(ctx, SBSYMCODELEN); |
291 | IARDX = jbig2_arith_int_ctx_new(ctx); | 291 | IARDX = jbig2_arith_int_ctx_new(ctx); |
@@ -543,7 +543,7 @@ jbig2_decode_symbol_dict(Jbig2Ctx *ctx, | |||
543 | uint32_t ID; | 543 | uint32_t ID; |
544 | int32_t RDX, RDY; | 544 | int32_t RDX, RDY; |
545 | int BMSIZE = 0; | 545 | int BMSIZE = 0; |
546 | int ninsyms = params->SDINSYMS->n_symbols; | 546 | int ninsyms = params->SDNUMINSYMS; |
547 | int code1 = 0; | 547 | int code1 = 0; |
548 | int code2 = 0; | 548 | int code2 = 0; |
549 | int code3 = 0; | 549 | int code3 = 0; |
@@ -960,17 +960,17 @@ jbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment, | |||
960 | /* maybe #ifdef CONFORMANCE and a separate routine */ | 960 | /* maybe #ifdef CONFORMANCE and a separate routine */ |
961 | if (!params.SDHUFF) { | 961 | if (!params.SDHUFF) { |
962 | if (flags & 0x000c) { | 962 | if (flags & 0x000c) { |
963 | jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number, | 963 | jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, |
964 | "SDHUFF is zero, but contrary to spec SDHUFFDH is not."); | 964 | "SDHUFF is zero, but contrary to spec SDHUFFDH is not."); |
965 | } | 965 | } |
966 | if (flags & 0x0030) { | 966 | if (flags & 0x0030) { |
967 | jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number, | 967 | jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, |
968 | "SDHUFF is zero, but contrary to spec SDHUFFDW is not."); | 968 | "SDHUFF is zero, but contrary to spec SDHUFFDW is not."); |
969 | } | 969 | } |
970 | } | 970 | } |
971 | 971 | ||
972 | if (flags & 0x0080) { | 972 | if (flags & 0x0080) { |
973 | jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number, | 973 | jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, |
974 | "bitmap coding context is used (NYI) symbol data likely to be garbage!"); | 974 | "bitmap coding context is used (NYI) symbol data likely to be garbage!"); |
975 | } | 975 | } |
976 | 976 | ||
diff --git a/jbig2_text.c b/jbig2_text.c index 73b9f57fb..6714e7ed1 100644 --- a/jbig2_text.c +++ b/jbig2_text.c | |||
@@ -321,6 +321,14 @@ cleanup1: | |||
321 | int code4 = 0; | 321 | int code4 = 0; |
322 | int code5 = 0; | 322 | int code5 = 0; |
323 | 323 | ||
324 | /* as must exist for refinement */ | ||
325 | if (as == NULL) | ||
326 | { | ||
327 | code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, | ||
328 | "as is NULL before refinement region"); | ||
329 | goto cleanup2; | ||
330 | } | ||
331 | |||
324 | /* 6.4.11 (1, 2, 3, 4) */ | 332 | /* 6.4.11 (1, 2, 3, 4) */ |
325 | if (!params->SBHUFF) { | 333 | if (!params->SBHUFF) { |
326 | code1 = jbig2_arith_int_decode(params->IARDW, as, &RDW); | 334 | code1 = jbig2_arith_int_decode(params->IARDW, as, &RDW); |