|
Lines 370-375
jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
Link Here
|
| 370 |
memcpy(region_params.gbat, params->sdat, sdat_bytes); |
370 |
memcpy(region_params.gbat, params->sdat, sdat_bytes); |
| 371 |
|
371 |
|
| 372 |
image = jbig2_image_new(ctx, SYMWIDTH, HCHEIGHT); |
372 |
image = jbig2_image_new(ctx, SYMWIDTH, HCHEIGHT); |
|
|
373 |
if (image == NULL) { |
| 374 |
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, |
| 375 |
"unable to allocate image storage"); |
| 376 |
/* todo: memory cleanup */ |
| 377 |
return NULL; |
| 378 |
} |
| 373 |
|
379 |
|
| 374 |
code = jbig2_decode_generic_region(ctx, segment, ®ion_params, |
380 |
code = jbig2_decode_generic_region(ctx, segment, ®ion_params, |
| 375 |
as, image, GB_stats); |
381 |
as, image, GB_stats); |
|
Lines 520-525
jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
Link Here
|
| 520 |
ID, RDX, RDY); |
526 |
ID, RDX, RDY); |
| 521 |
|
527 |
|
| 522 |
image = jbig2_image_new(ctx, SYMWIDTH, HCHEIGHT); |
528 |
image = jbig2_image_new(ctx, SYMWIDTH, HCHEIGHT); |
|
|
529 |
if (image == NULL) { |
| 530 |
code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, |
| 531 |
"Out of memory creating symbol image"); |
| 532 |
/* todo: memory cleanup */ |
| 533 |
return NULL; |
| 534 |
} |
| 523 |
|
535 |
|
| 524 |
/* Table 18 */ |
536 |
/* Table 18 */ |
| 525 |
rparams.GRTEMPLATE = params->SDRTEMPLATE; |
537 |
rparams.GRTEMPLATE = params->SDRTEMPLATE; |
|
Lines 638-643
jbig2_decode_symbol_dict(Jbig2Ctx *ctx,
Link Here
|
| 638 |
for (j = HCFIRSTSYM; j < NSYMSDECODED; j++) { |
650 |
for (j = HCFIRSTSYM; j < NSYMSDECODED; j++) { |
| 639 |
Jbig2Image *glyph; |
651 |
Jbig2Image *glyph; |
| 640 |
glyph = jbig2_image_new(ctx, SDNEWSYMWIDTHS[j], HCHEIGHT); |
652 |
glyph = jbig2_image_new(ctx, SDNEWSYMWIDTHS[j], HCHEIGHT); |
|
|
653 |
if (glyph == NULL) { |
| 654 |
jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, |
| 655 |
"unable to allocate image storage"); |
| 656 |
/* todo: memory cleanup */ |
| 657 |
return NULL; |
| 658 |
} |
| 659 |
|
| 641 |
jbig2_image_compose(ctx, glyph, image, |
660 |
jbig2_image_compose(ctx, glyph, image, |
| 642 |
-x, 0, JBIG2_COMPOSE_REPLACE); |
661 |
-x, 0, JBIG2_COMPOSE_REPLACE); |
| 643 |
x += SDNEWSYMWIDTHS[j]; |
662 |
x += SDNEWSYMWIDTHS[j]; |