idx
int64 | func_before
string | Vulnerability Classification
string | vul
int64 | func_after
string | patch
string | CWE ID
string | lines_before
string | lines_after
string |
|---|---|---|---|---|---|---|---|---|
300
|
fz_new_colorspace(fz_context *ctx,
const char *name,
enum fz_colorspace_type type, int flags, int n,
fz_colorspace_convert_fn *to_ccs,
fz_colorspace_convert_fn *from_ccs,
fz_colorspace_base_fn *base,
fz_colorspace_clamp_fn *clamp,
fz_colorspace_destruct_fn *destruct,
void *data, size_t size)
{
fz_colorspace *cs = fz_malloc_struct(ctx, fz_colorspace);
FZ_INIT_KEY_STORABLE(cs, 1, fz_drop_colorspace_imp);
cs->size = sizeof(fz_colorspace) + size;
fz_strlcpy(cs->name, name ? name : "UNKNOWN", sizeof cs->name);
cs->type = type;
cs->flags = flags;
cs->n = n;
cs->to_ccs = to_ccs;
cs->from_ccs = from_ccs;
cs->get_base = base;
if (clamp != NULL)
cs->clamp = clamp;
else
cs->clamp = clamp_default;
cs->free_data = destruct;
cs->data = data;
return cs;
}
|
DoS
| 0
|
fz_new_colorspace(fz_context *ctx,
const char *name,
enum fz_colorspace_type type, int flags, int n,
fz_colorspace_convert_fn *to_ccs,
fz_colorspace_convert_fn *from_ccs,
fz_colorspace_base_fn *base,
fz_colorspace_clamp_fn *clamp,
fz_colorspace_destruct_fn *destruct,
void *data, size_t size)
{
fz_colorspace *cs = fz_malloc_struct(ctx, fz_colorspace);
FZ_INIT_KEY_STORABLE(cs, 1, fz_drop_colorspace_imp);
cs->size = sizeof(fz_colorspace) + size;
fz_strlcpy(cs->name, name ? name : "UNKNOWN", sizeof cs->name);
cs->type = type;
cs->flags = flags;
cs->n = n;
cs->to_ccs = to_ccs;
cs->from_ccs = from_ccs;
cs->get_base = base;
if (clamp != NULL)
cs->clamp = clamp;
else
cs->clamp = clamp_default;
cs->free_data = destruct;
cs->data = data;
return cs;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
301
|
void fz_new_colorspace_context(fz_context *ctx)
{
ctx->colorspace = fz_malloc_struct(ctx, fz_colorspace_context);
ctx->colorspace->ctx_refs = 1;
set_no_icc(ctx->colorspace);
#ifdef NO_ICC
fz_set_cmm_engine(ctx, NULL);
#else
fz_set_cmm_engine(ctx, &fz_cmm_engine_lcms);
#endif
}
|
DoS
| 0
|
void fz_new_colorspace_context(fz_context *ctx)
{
ctx->colorspace = fz_malloc_struct(ctx, fz_colorspace_context);
ctx->colorspace->ctx_refs = 1;
set_no_icc(ctx->colorspace);
#ifdef NO_ICC
fz_set_cmm_engine(ctx, NULL);
#else
fz_set_cmm_engine(ctx, &fz_cmm_engine_lcms);
#endif
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
302
|
fz_new_default_colorspaces(fz_context *ctx)
{
fz_default_colorspaces *default_cs = fz_malloc_struct(ctx, fz_default_colorspaces);
default_cs->refs = 1;
default_cs->gray = fz_keep_colorspace(ctx, fz_device_gray(ctx));
default_cs->rgb = fz_keep_colorspace(ctx, fz_device_rgb(ctx));
default_cs->cmyk = fz_keep_colorspace(ctx, fz_device_cmyk(ctx));
default_cs->oi = NULL;
return default_cs;
}
|
DoS
| 0
|
fz_new_default_colorspaces(fz_context *ctx)
{
fz_default_colorspaces *default_cs = fz_malloc_struct(ctx, fz_default_colorspaces);
default_cs->refs = 1;
default_cs->gray = fz_keep_colorspace(ctx, fz_device_gray(ctx));
default_cs->rgb = fz_keep_colorspace(ctx, fz_device_rgb(ctx));
default_cs->cmyk = fz_keep_colorspace(ctx, fz_device_cmyk(ctx));
default_cs->oi = NULL;
return default_cs;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
303
|
fz_colorspace *fz_new_icc_colorspace_from_file(fz_context *ctx, const char *name, const char *path)
{
fz_colorspace *cs = NULL;
fz_buffer *buffer = fz_read_file(ctx, path);
fz_try(ctx)
cs = fz_new_icc_colorspace(ctx, name, 0, buffer);
fz_always(ctx)
fz_drop_buffer(ctx, buffer);
fz_catch(ctx)
fz_rethrow(ctx);
return cs;
}
|
DoS
| 0
|
fz_colorspace *fz_new_icc_colorspace_from_file(fz_context *ctx, const char *name, const char *path)
{
fz_colorspace *cs = NULL;
fz_buffer *buffer = fz_read_file(ctx, path);
fz_try(ctx)
cs = fz_new_icc_colorspace(ctx, name, 0, buffer);
fz_always(ctx)
fz_drop_buffer(ctx, buffer);
fz_catch(ctx)
fz_rethrow(ctx);
return cs;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
304
|
fz_colorspace *fz_new_icc_colorspace_from_stream(fz_context *ctx, const char *name, fz_stream *in)
{
fz_colorspace *cs = NULL;
fz_buffer *buffer = fz_read_all(ctx, in, 1024);
fz_try(ctx)
cs = fz_new_icc_colorspace(ctx, name, 0, buffer);
fz_always(ctx)
fz_drop_buffer(ctx, buffer);
fz_catch(ctx)
fz_rethrow(ctx);
return cs;
}
|
DoS
| 0
|
fz_colorspace *fz_new_icc_colorspace_from_stream(fz_context *ctx, const char *name, fz_stream *in)
{
fz_colorspace *cs = NULL;
fz_buffer *buffer = fz_read_all(ctx, in, 1024);
fz_try(ctx)
cs = fz_new_icc_colorspace(ctx, name, 0, buffer);
fz_always(ctx)
fz_drop_buffer(ctx, buffer);
fz_catch(ctx)
fz_rethrow(ctx);
return cs;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
305
|
fz_new_icc_link(fz_context *ctx, fz_iccprofile *dst, int dst_extras, fz_iccprofile *src, int src_extras, fz_iccprofile *prf, const fz_color_params *rend, int num_bytes, int copy_extras)
{
fz_icclink *link = fz_malloc_struct(ctx, fz_icclink);
FZ_INIT_STORABLE(link, 1, fz_drop_link_imp);
if (memcmp(src->md5, dst->md5, 16) == 0 && prf == NULL)
{
link->is_identity = 1;
return link;
}
fz_try(ctx)
fz_cmm_init_link(ctx, link, dst, dst_extras, src, src_extras, prf, rend, 0, num_bytes, copy_extras);
fz_catch(ctx)
{
fz_free(ctx, link);
fz_rethrow(ctx);
}
return link;
}
|
DoS
| 0
|
fz_new_icc_link(fz_context *ctx, fz_iccprofile *dst, int dst_extras, fz_iccprofile *src, int src_extras, fz_iccprofile *prf, const fz_color_params *rend, int num_bytes, int copy_extras)
{
fz_icclink *link = fz_malloc_struct(ctx, fz_icclink);
FZ_INIT_STORABLE(link, 1, fz_drop_link_imp);
if (memcmp(src->md5, dst->md5, 16) == 0 && prf == NULL)
{
link->is_identity = 1;
return link;
}
fz_try(ctx)
fz_cmm_init_link(ctx, link, dst, dst_extras, src, src_extras, prf, rend, 0, num_bytes, copy_extras);
fz_catch(ctx)
{
fz_free(ctx, link);
fz_rethrow(ctx);
}
return link;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
306
|
fz_new_indexed_colorspace(fz_context *ctx, fz_colorspace *base, int high, unsigned char *lookup)
{
fz_colorspace *cs = NULL;
struct indexed *idx;
idx = fz_malloc_struct(ctx, struct indexed);
idx->lookup = lookup;
idx->base = fz_keep_colorspace(ctx, base);
idx->high = high;
fz_try(ctx)
cs = fz_new_colorspace(ctx, "Indexed", FZ_COLORSPACE_INDEXED, 0, 1, fz_colorspace_is_icc(ctx, fz_device_rgb(ctx)) ? indexed_to_alt : indexed_to_rgb, NULL, base_indexed, clamp_indexed, free_indexed, idx, sizeof(*idx) + (base->n * (idx->high + 1)) + base->size);
fz_catch(ctx)
{
fz_free(ctx, idx);
fz_rethrow(ctx);
}
return cs;
}
|
DoS
| 0
|
fz_new_indexed_colorspace(fz_context *ctx, fz_colorspace *base, int high, unsigned char *lookup)
{
fz_colorspace *cs = NULL;
struct indexed *idx;
idx = fz_malloc_struct(ctx, struct indexed);
idx->lookup = lookup;
idx->base = fz_keep_colorspace(ctx, base);
idx->high = high;
fz_try(ctx)
cs = fz_new_colorspace(ctx, "Indexed", FZ_COLORSPACE_INDEXED, 0, 1, fz_colorspace_is_icc(ctx, fz_device_rgb(ctx)) ? indexed_to_alt : indexed_to_rgb, NULL, base_indexed, clamp_indexed, free_indexed, idx, sizeof(*idx) + (base->n * (idx->high + 1)) + base->size);
fz_catch(ctx)
{
fz_free(ctx, idx);
fz_rethrow(ctx);
}
return cs;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
307
|
fz_rendering_intent_name(int ri)
{
if (ri >= 0 && ri < nelem(fz_intent_names))
return (char*)fz_intent_names[ri];
return "RelativeColorimetric";
}
|
DoS
| 0
|
fz_rendering_intent_name(int ri)
{
if (ri >= 0 && ri < nelem(fz_intent_names))
return (char*)fz_intent_names[ri];
return "RelativeColorimetric";
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
308
|
void fz_set_cmm_engine(fz_context *ctx, const fz_cmm_engine *engine)
{
fz_colorspace_context *cct;
if (!ctx)
return;
cct = ctx->colorspace;
if (!cct)
return;
#ifdef NO_ICC
if (engine)
fz_throw(ctx, FZ_ERROR_GENERIC, "ICC workflow not supported in NO_ICC build");
#else
if (cct->cmm == engine)
return;
fz_drop_cmm_context(ctx);
fz_drop_colorspace(ctx, cct->gray);
fz_drop_colorspace(ctx, cct->rgb);
fz_drop_colorspace(ctx, cct->bgr);
fz_drop_colorspace(ctx, cct->cmyk);
fz_drop_colorspace(ctx, cct->lab);
cct->gray = NULL;
cct->rgb = NULL;
cct->bgr = NULL;
cct->cmyk = NULL;
cct->lab = NULL;
cct->cmm = engine;
fz_new_cmm_context(ctx);
if (engine)
{
cct->gray = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_GRAY, 1, NULL);
cct->rgb = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_RGB, 3, NULL);
cct->bgr = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_BGR, 3, NULL);
cct->cmyk = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_CMYK, 4, NULL);
cct->lab = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_LAB, 3, NULL);
}
else
set_no_icc(cct);
#endif
}
|
DoS
| 0
|
void fz_set_cmm_engine(fz_context *ctx, const fz_cmm_engine *engine)
{
fz_colorspace_context *cct;
if (!ctx)
return;
cct = ctx->colorspace;
if (!cct)
return;
#ifdef NO_ICC
if (engine)
fz_throw(ctx, FZ_ERROR_GENERIC, "ICC workflow not supported in NO_ICC build");
#else
if (cct->cmm == engine)
return;
fz_drop_cmm_context(ctx);
fz_drop_colorspace(ctx, cct->gray);
fz_drop_colorspace(ctx, cct->rgb);
fz_drop_colorspace(ctx, cct->bgr);
fz_drop_colorspace(ctx, cct->cmyk);
fz_drop_colorspace(ctx, cct->lab);
cct->gray = NULL;
cct->rgb = NULL;
cct->bgr = NULL;
cct->cmyk = NULL;
cct->lab = NULL;
cct->cmm = engine;
fz_new_cmm_context(ctx);
if (engine)
{
cct->gray = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_GRAY, 1, NULL);
cct->rgb = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_RGB, 3, NULL);
cct->bgr = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_BGR, 3, NULL);
cct->cmyk = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_CMYK, 4, NULL);
cct->lab = fz_new_icc_colorspace(ctx, FZ_ICC_PROFILE_LAB, 3, NULL);
}
else
set_no_icc(cct);
#endif
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
309
|
fz_set_default_gray(fz_context *ctx, fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
if (cs->n == 1)
{
fz_drop_colorspace(ctx, default_cs->gray);
default_cs->gray = fz_keep_colorspace(ctx, cs);
}
}
|
DoS
| 0
|
fz_set_default_gray(fz_context *ctx, fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
if (cs->n == 1)
{
fz_drop_colorspace(ctx, default_cs->gray);
default_cs->gray = fz_keep_colorspace(ctx, cs);
}
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
310
|
fz_set_default_output_intent(fz_context *ctx, fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
fz_drop_colorspace(ctx, default_cs->oi);
default_cs->oi = fz_keep_colorspace(ctx, cs);
switch (cs->n)
{
case 1:
if (default_cs->gray == fz_device_gray(ctx))
{
fz_drop_colorspace(ctx, default_cs->gray);
default_cs->gray = fz_keep_colorspace(ctx, cs);
}
break;
case 3:
if (default_cs->rgb == fz_device_rgb(ctx))
{
fz_drop_colorspace(ctx, default_cs->rgb);
default_cs->rgb = fz_keep_colorspace(ctx, cs);
}
break;
case 4:
if (default_cs->cmyk == fz_device_cmyk(ctx))
{
fz_drop_colorspace(ctx, default_cs->cmyk);
default_cs->cmyk = fz_keep_colorspace(ctx, cs);
}
break;
}
}
|
DoS
| 0
|
fz_set_default_output_intent(fz_context *ctx, fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
fz_drop_colorspace(ctx, default_cs->oi);
default_cs->oi = fz_keep_colorspace(ctx, cs);
switch (cs->n)
{
case 1:
if (default_cs->gray == fz_device_gray(ctx))
{
fz_drop_colorspace(ctx, default_cs->gray);
default_cs->gray = fz_keep_colorspace(ctx, cs);
}
break;
case 3:
if (default_cs->rgb == fz_device_rgb(ctx))
{
fz_drop_colorspace(ctx, default_cs->rgb);
default_cs->rgb = fz_keep_colorspace(ctx, cs);
}
break;
case 4:
if (default_cs->cmyk == fz_device_cmyk(ctx))
{
fz_drop_colorspace(ctx, default_cs->cmyk);
default_cs->cmyk = fz_keep_colorspace(ctx, cs);
}
break;
}
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
311
|
void fz_set_icc_bgr(fz_context *ctx, fz_colorspace *cs)
{
fz_iccprofile *profile;
if (cs == NULL || !fz_colorspace_is_icc(ctx, cs))
return;
profile = cs->data;
profile->bgr = 1;
return;
}
|
DoS
| 0
|
void fz_set_icc_bgr(fz_context *ctx, fz_colorspace *cs)
{
fz_iccprofile *profile;
if (cs == NULL || !fz_colorspace_is_icc(ctx, cs))
return;
profile = cs->data;
profile->bgr = 1;
return;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
312
|
fz_source_colorspace_cm(fz_context *ctx, const fz_colorspace *cs)
{
while (cs)
{
if (fz_colorspace_is_icc(ctx, cs))
return cs;
if (fz_colorspace_is_cal(ctx, cs))
return cs;
cs = fz_colorspace_base(ctx, cs);
}
return NULL;
}
|
DoS
| 0
|
fz_source_colorspace_cm(fz_context *ctx, const fz_colorspace *cs)
{
while (cs)
{
if (fz_colorspace_is_icc(ctx, cs))
return cs;
if (fz_colorspace_is_cal(ctx, cs))
return cs;
cs = fz_colorspace_base(ctx, cs);
}
return NULL;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
313
|
g2cmyk(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = 0;
dv[1] = 0;
dv[2] = 0;
dv[3] = 1 - sv[0];
}
|
DoS
| 0
|
g2cmyk(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = 0;
dv[1] = 0;
dv[2] = 0;
dv[3] = 1 - sv[0];
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
314
|
g2rgb(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = sv[0];
dv[1] = sv[0];
dv[2] = sv[0];
}
|
DoS
| 0
|
g2rgb(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = sv[0];
dv[1] = sv[0];
dv[2] = sv[0];
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
315
|
get_base_icc_profile(fz_context *ctx, const fz_colorspace *cs)
{
fz_colorspace *base;
fz_cal_colorspace *cal;
fz_iccprofile *cal_icc;
if (!cs || !cs->get_base)
return NULL;
base = cs->get_base(cs);
if (base == NULL)
return NULL;
if (fz_colorspace_is_icc(ctx, base))
return base->data;
if (!fz_colorspace_is_cal(ctx, base))
return get_base_icc_profile(ctx, base);
cal = base->data;
cal_icc = cal->profile;
if (cal_icc && cal_icc->cmm_handle == NULL)
fz_cmm_init_profile(ctx, cal_icc);
return cal_icc;
}
|
DoS
| 0
|
get_base_icc_profile(fz_context *ctx, const fz_colorspace *cs)
{
fz_colorspace *base;
fz_cal_colorspace *cal;
fz_iccprofile *cal_icc;
if (!cs || !cs->get_base)
return NULL;
base = cs->get_base(cs);
if (base == NULL)
return NULL;
if (fz_colorspace_is_icc(ctx, base))
return base->data;
if (!fz_colorspace_is_cal(ctx, base))
return get_base_icc_profile(ctx, base);
cal = base->data;
cal_icc = cal->profile;
if (cal_icc && cal_icc->cmm_handle == NULL)
fz_cmm_init_profile(ctx, cal_icc);
return cal_icc;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
316
|
static void gray_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *gray, float *rgb)
{
rgb[0] = gray[0];
rgb[1] = gray[0];
rgb[2] = gray[0];
}
|
DoS
| 0
|
static void gray_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *gray, float *rgb)
{
rgb[0] = gray[0];
rgb[1] = gray[0];
rgb[2] = gray[0];
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
317
|
icc_base_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv)
{
const fz_colorspace *srcs = cc->ss;
float local_src_map[FZ_MAX_COLORS];
float local_src_map2[FZ_MAX_COLORS];
float *src_map = local_src_map;
do
{
srcs->to_ccs(ctx, srcs, srcv, src_map);
srcs = srcs->get_base(srcs);
srcs->clamp(srcs, src_map, src_map);
srcv = src_map;
src_map = (src_map == local_src_map ? local_src_map2 : local_src_map);
}
while (!fz_colorspace_is_icc(ctx, srcs) && !fz_colorspace_is_cal(ctx, srcs));
icc_conv_color(ctx, cc, dstv, srcv);
}
|
DoS
| 0
|
icc_base_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv)
{
const fz_colorspace *srcs = cc->ss;
float local_src_map[FZ_MAX_COLORS];
float local_src_map2[FZ_MAX_COLORS];
float *src_map = local_src_map;
do
{
srcs->to_ccs(ctx, srcs, srcv, src_map);
srcs = srcs->get_base(srcs);
srcs->clamp(srcs, src_map, src_map);
srcv = src_map;
src_map = (src_map == local_src_map ? local_src_map2 : local_src_map);
}
while (!fz_colorspace_is_icc(ctx, srcs) && !fz_colorspace_is_cal(ctx, srcs));
icc_conv_color(ctx, cc, dstv, srcv);
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
318
|
icc_base_conv_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz_colorspace *prf, const fz_default_colorspaces *default_cs, const fz_color_params *color_params, int copy_spots)
{
fz_colorspace *srcs = src->colorspace;
fz_colorspace *base_cs = get_base_icc_space(ctx, srcs);
int i, j;
unsigned char *inputpos, *outputpos;
fz_pixmap *base;
fz_irect bbox;
int h, len;
float src_f[FZ_MAX_COLORS], des_f[FZ_MAX_COLORS];
int sn = src->n;
int sc = sn - src->alpha - src->s;
int stride_src = src->stride - src->w * sn;
int stride_base;
int bn, bc;
base = fz_new_pixmap_with_bbox(ctx, base_cs, fz_pixmap_bbox(ctx, src, &bbox), src->seps, src->alpha);
bn = base->n;
bc = base->n - base->alpha - base->s;
stride_base = base->stride - base->w * bn;
inputpos = src->samples;
outputpos = base->samples;
h = src->h;
while (h--)
{
len = src->w;
while (len--)
{
/* Convert the actual colors */
for (i = 0; i < sc; i++)
src_f[i] = (float) inputpos[i] / 255.0f;
convert_to_icc_base(ctx, srcs, src_f, des_f);
base_cs->clamp(base_cs, des_f, des_f);
for (j = 0; j < bc; j++)
outputpos[j] = des_f[j] * 255.0f;
/* Copy spots and alphas unchanged */
for (; i < sn; i++, j++)
outputpos[j] = inputpos[i];
outputpos += bn;
inputpos += sn;
}
outputpos += stride_base;
inputpos += stride_src;
}
fz_try(ctx)
icc_conv_pixmap(ctx, dst, base, prf, default_cs, color_params, copy_spots);
fz_always(ctx)
fz_drop_pixmap(ctx, base);
fz_catch(ctx)
fz_rethrow(ctx);
}
|
DoS
| 0
|
icc_base_conv_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz_colorspace *prf, const fz_default_colorspaces *default_cs, const fz_color_params *color_params, int copy_spots)
{
fz_colorspace *srcs = src->colorspace;
fz_colorspace *base_cs = get_base_icc_space(ctx, srcs);
int i, j;
unsigned char *inputpos, *outputpos;
fz_pixmap *base;
fz_irect bbox;
int h, len;
float src_f[FZ_MAX_COLORS], des_f[FZ_MAX_COLORS];
int sn = src->n;
int sc = sn - src->alpha - src->s;
int stride_src = src->stride - src->w * sn;
int stride_base;
int bn, bc;
base = fz_new_pixmap_with_bbox(ctx, base_cs, fz_pixmap_bbox(ctx, src, &bbox), src->seps, src->alpha);
bn = base->n;
bc = base->n - base->alpha - base->s;
stride_base = base->stride - base->w * bn;
inputpos = src->samples;
outputpos = base->samples;
h = src->h;
while (h--)
{
len = src->w;
while (len--)
{
/* Convert the actual colors */
for (i = 0; i < sc; i++)
src_f[i] = (float) inputpos[i] / 255.0f;
convert_to_icc_base(ctx, srcs, src_f, des_f);
base_cs->clamp(base_cs, des_f, des_f);
for (j = 0; j < bc; j++)
outputpos[j] = des_f[j] * 255.0f;
/* Copy spots and alphas unchanged */
for (; i < sn; i++, j++)
outputpos[j] = inputpos[i];
outputpos += bn;
inputpos += sn;
}
outputpos += stride_base;
inputpos += stride_src;
}
fz_try(ctx)
icc_conv_pixmap(ctx, dst, base, prf, default_cs, color_params, copy_spots);
fz_always(ctx)
fz_drop_pixmap(ctx, base);
fz_catch(ctx)
fz_rethrow(ctx);
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
319
|
icc_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv)
{
const fz_colorspace *dsts = cc->ds;
int src_n = cc->n;
int dst_n = dsts->n;
fz_icclink *link = (fz_icclink *)cc->link;
int i;
unsigned short dstv_s[FZ_MAX_COLORS];
unsigned short srcv_s[FZ_MAX_COLORS];
/* Special case. Link is NULL if we are doing DeviceGray to CMYK */
if (link == NULL)
{
dstv[0] = 0;
dstv[1] = 0;
dstv[2] = 0;
dstv[3] = 1 - srcv[0];
}
else if (link->is_identity)
{
for (i = 0; i < src_n; i++)
dstv[i] = srcv[i];
}
else
{
for (i = 0; i < src_n; i++)
srcv_s[i] = srcv[i] * 65535;
fz_cmm_transform_color(ctx, link, dstv_s, srcv_s);
for (i = 0; i < dst_n; i++)
dstv[i] = fz_clamp((float) dstv_s[i] / 65535.0f, 0, 1);
}
}
|
DoS
| 0
|
icc_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv)
{
const fz_colorspace *dsts = cc->ds;
int src_n = cc->n;
int dst_n = dsts->n;
fz_icclink *link = (fz_icclink *)cc->link;
int i;
unsigned short dstv_s[FZ_MAX_COLORS];
unsigned short srcv_s[FZ_MAX_COLORS];
/* Special case. Link is NULL if we are doing DeviceGray to CMYK */
if (link == NULL)
{
dstv[0] = 0;
dstv[1] = 0;
dstv[2] = 0;
dstv[3] = 1 - srcv[0];
}
else if (link->is_identity)
{
for (i = 0; i < src_n; i++)
dstv[i] = srcv[i];
}
else
{
for (i = 0; i < src_n; i++)
srcv_s[i] = srcv[i] * 65535;
fz_cmm_transform_color(ctx, link, dstv_s, srcv_s);
for (i = 0; i < dst_n; i++)
dstv[i] = fz_clamp((float) dstv_s[i] / 65535.0f, 0, 1);
}
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
320
|
indexed_to_alt(fz_context *ctx, const fz_colorspace *cs, const float *color, float *alt)
{
struct indexed *idx = cs->data;
int i, k;
int n = idx->base->n;
i = color[0] * 255;
i = fz_clampi(i, 0, idx->high);
for (k = 0; k < n; k++)
alt[k] = idx->lookup[i * n + k] / 255.0f;
}
|
DoS
| 0
|
indexed_to_alt(fz_context *ctx, const fz_colorspace *cs, const float *color, float *alt)
{
struct indexed *idx = cs->data;
int i, k;
int n = idx->base->n;
i = color[0] * 255;
i = fz_clampi(i, 0, idx->high);
for (k = 0; k < n; k++)
alt[k] = idx->lookup[i * n + k] / 255.0f;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
321
|
indexed_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *color, float *rgb)
{
float alt[FZ_MAX_COLORS];
struct indexed *idx = cs->data;
indexed_to_alt(ctx, cs, color, alt);
idx->base->to_ccs(ctx, idx->base, alt, rgb);
}
|
DoS
| 0
|
indexed_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *color, float *rgb)
{
float alt[FZ_MAX_COLORS];
struct indexed *idx = cs->data;
indexed_to_alt(ctx, cs, color, alt);
idx->base->to_ccs(ctx, idx->base, alt, rgb);
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
322
|
lab_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *lab, float *rgb)
{
/* input is in range (0..100, -128..127, -128..127) not (0..1, 0..1, 0..1) */
float lstar, astar, bstar, l, m, n, x, y, z, r, g, b;
lstar = lab[0];
astar = lab[1];
bstar = lab[2];
m = (lstar + 16) / 116;
l = m + astar / 500;
n = m - bstar / 200;
x = fung(l);
y = fung(m);
z = fung(n);
r = (3.240449f * x + -1.537136f * y + -0.498531f * z) * 0.830026f;
g = (-0.969265f * x + 1.876011f * y + 0.041556f * z) * 1.05452f;
b = (0.055643f * x + -0.204026f * y + 1.057229f * z) * 1.1003f;
rgb[0] = sqrtf(fz_clamp(r, 0, 1));
rgb[1] = sqrtf(fz_clamp(g, 0, 1));
rgb[2] = sqrtf(fz_clamp(b, 0, 1));
}
|
DoS
| 0
|
lab_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *lab, float *rgb)
{
/* input is in range (0..100, -128..127, -128..127) not (0..1, 0..1, 0..1) */
float lstar, astar, bstar, l, m, n, x, y, z, r, g, b;
lstar = lab[0];
astar = lab[1];
bstar = lab[2];
m = (lstar + 16) / 116;
l = m + astar / 500;
n = m - bstar / 200;
x = fung(l);
y = fung(m);
z = fung(n);
r = (3.240449f * x + -1.537136f * y + -0.498531f * z) * 0.830026f;
g = (-0.969265f * x + 1.876011f * y + 0.041556f * z) * 1.05452f;
b = (0.055643f * x + -0.204026f * y + 1.057229f * z) * 1.1003f;
rgb[0] = sqrtf(fz_clamp(r, 0, 1));
rgb[1] = sqrtf(fz_clamp(g, 0, 1));
rgb[2] = sqrtf(fz_clamp(b, 0, 1));
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
323
|
rgb2bgr(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = sv[2];
dv[1] = sv[1];
dv[2] = sv[0];
}
|
DoS
| 0
|
rgb2bgr(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = sv[2];
dv[1] = sv[1];
dv[2] = sv[0];
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
324
|
rgb2g(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = sv[0] * 0.3f + sv[1] * 0.59f + sv[2] * 0.11f;
}
|
DoS
| 0
|
rgb2g(fz_context *ctx, fz_color_converter *cc, float *dv, const float *sv)
{
dv[0] = sv[0] * 0.3f + sv[1] * 0.59f + sv[2] * 0.11f;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
325
|
static void rgb_to_bgr(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *bgr)
{
bgr[0] = rgb[2];
bgr[1] = rgb[1];
bgr[2] = rgb[0];
}
|
DoS
| 0
|
static void rgb_to_bgr(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *bgr)
{
bgr[0] = rgb[2];
bgr[1] = rgb[1];
bgr[2] = rgb[0];
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
326
|
static void rgb_to_cmyk(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *cmyk)
{
float c, m, y, k;
c = 1 - rgb[0];
m = 1 - rgb[1];
y = 1 - rgb[2];
k = fz_min(c, fz_min(m, y));
cmyk[0] = c - k;
cmyk[1] = m - k;
cmyk[2] = y - k;
cmyk[3] = k;
}
|
DoS
| 0
|
static void rgb_to_cmyk(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *cmyk)
{
float c, m, y, k;
c = 1 - rgb[0];
m = 1 - rgb[1];
y = 1 - rgb[2];
k = fz_min(c, fz_min(m, y));
cmyk[0] = c - k;
cmyk[1] = m - k;
cmyk[2] = y - k;
cmyk[3] = k;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
327
|
static void rgb_to_gray(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *gray)
{
float r = rgb[0];
float g = rgb[1];
float b = rgb[2];
gray[0] = r * 0.3f + g * 0.59f + b * 0.11f;
}
|
DoS
| 0
|
static void rgb_to_gray(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *gray)
{
float r = rgb[0];
float g = rgb[1];
float b = rgb[2];
gray[0] = r * 0.3f + g * 0.59f + b * 0.11f;
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
328
|
static void rgb_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *xyz)
{
xyz[0] = rgb[0];
xyz[1] = rgb[1];
xyz[2] = rgb[2];
}
|
DoS
| 0
|
static void rgb_to_rgb(fz_context *ctx, const fz_colorspace *cs, const float *rgb, float *xyz)
{
xyz[0] = rgb[0];
xyz[1] = rgb[1];
xyz[2] = rgb[2];
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
329
|
std_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv)
{
float rgb[3];
int i;
const fz_colorspace *srcs = cc->ss;
const fz_colorspace *dsts = cc->ds;
if (srcs == NULL)
srcs = fz_device_rgb(ctx);
if (dsts == NULL)
dsts = fz_device_rgb(ctx);
if (srcs != dsts)
{
assert(srcs->to_ccs && dsts->from_ccs);
srcs->to_ccs(ctx, srcs, srcv, rgb);
dsts->from_ccs(ctx, dsts, rgb, dstv);
for (i = 0; i < dsts->n; i++)
dstv[i] = fz_clamp(dstv[i], 0, 1);
}
else
{
for (i = 0; i < srcs->n; i++)
dstv[i] = srcv[i];
}
}
|
DoS
| 0
|
std_conv_color(fz_context *ctx, fz_color_converter *cc, float *dstv, const float *srcv)
{
float rgb[3];
int i;
const fz_colorspace *srcs = cc->ss;
const fz_colorspace *dsts = cc->ds;
if (srcs == NULL)
srcs = fz_device_rgb(ctx);
if (dsts == NULL)
dsts = fz_device_rgb(ctx);
if (srcs != dsts)
{
assert(srcs->to_ccs && dsts->from_ccs);
srcs->to_ccs(ctx, srcs, srcv, rgb);
dsts->from_ccs(ctx, dsts, rgb, dstv);
for (i = 0; i < dsts->n; i++)
dstv[i] = fz_clamp(dstv[i], 0, 1);
}
else
{
for (i = 0; i < srcs->n; i++)
dstv[i] = srcv[i];
}
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
330
|
std_conv_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz_colorspace *prf, const fz_default_colorspaces *default_cs, const fz_color_params *color_params, int copy_spots)
{
float srcv[FZ_MAX_COLORS];
float dstv[FZ_MAX_COLORS];
int srcn, dstn;
int k, i;
size_t w = src->w;
int h = src->h;
ptrdiff_t d_line_inc = dst->stride - w * dst->n;
ptrdiff_t s_line_inc = src->stride - w * src->n;
int da = dst->alpha;
int sa = src->alpha;
fz_colorspace *ss = src->colorspace;
fz_colorspace *ds = dst->colorspace;
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
if ((int)w < 0 || h < 0)
return;
if (color_params == NULL)
color_params = fz_default_color_params(ctx);
srcn = ss->n;
dstn = ds->n;
assert(src->w == dst->w && src->h == dst->h);
assert(src->n == srcn + sa);
assert(dst->n == dstn + da);
if (d_line_inc == 0 && s_line_inc == 0)
{
w *= h;
h = 1;
}
/* Special case for Lab colorspace (scaling of components to float) */
if ((fz_colorspace_is_lab(ctx, ss) || fz_colorspace_is_lab_icc(ctx, ss)) && srcn == 3)
{
fz_color_converter cc;
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
while (h--)
{
size_t ww = w;
while (ww--)
{
srcv[0] = *s++ / 255.0f * 100;
srcv[1] = *s++ - 128;
srcv[2] = *s++ - 128;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
*d++ = dstv[k] * 255;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
d += d_line_inc;
s += s_line_inc;
}
fz_drop_color_converter(ctx, &cc);
}
/* Brute-force for small images */
else if (w*h < 256)
{
fz_color_converter cc;
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
while (h--)
{
size_t ww = w;
while (ww--)
{
for (k = 0; k < srcn; k++)
srcv[k] = *s++ / 255.0f;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
*d++ = dstv[k] * 255;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
d += d_line_inc;
s += s_line_inc;
}
fz_drop_color_converter(ctx, &cc);
}
/* 1-d lookup table for separation and similar colorspaces */
else if (srcn == 1)
{
unsigned char lookup[FZ_MAX_COLORS * 256];
fz_color_converter cc;
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
for (i = 0; i < 256; i++)
{
srcv[0] = i / 255.0f;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
lookup[i * dstn + k] = dstv[k] * 255;
}
fz_drop_color_converter(ctx, &cc);
while (h--)
{
size_t ww = w;
while (ww--)
{
i = *s++;
for (k = 0; k < dstn; k++)
*d++ = lookup[i * dstn + k];
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
d += d_line_inc;
s += s_line_inc;
}
}
/* Memoize colors using a hash table for the general case */
else
{
fz_hash_table *lookup;
unsigned char *color;
unsigned char dummy = s[0] ^ 255;
unsigned char *sold = &dummy;
unsigned char *dold;
fz_color_converter cc;
lookup = fz_new_hash_table(ctx, 509, srcn, -1, NULL);
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
fz_try(ctx)
{
while (h--)
{
size_t ww = w;
while (ww--)
{
if (*s == *sold && memcmp(sold,s,srcn) == 0)
{
sold = s;
memcpy(d, dold, dstn);
d += dstn;
s += srcn;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
else
{
sold = s;
dold = d;
color = fz_hash_find(ctx, lookup, s);
if (color)
{
memcpy(d, color, dstn);
s += srcn;
d += dstn;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
else
{
for (k = 0; k < srcn; k++)
srcv[k] = *s++ / 255.0f;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
*d++ = dstv[k] * 255;
fz_hash_insert(ctx, lookup, s - srcn, d - dstn);
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
}
}
d += d_line_inc;
s += s_line_inc;
}
}
fz_always(ctx)
fz_drop_color_converter(ctx, &cc);
fz_catch(ctx)
fz_rethrow(ctx);
fz_drop_hash_table(ctx, lookup);
}
}
|
DoS
| 0
|
std_conv_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src, fz_colorspace *prf, const fz_default_colorspaces *default_cs, const fz_color_params *color_params, int copy_spots)
{
float srcv[FZ_MAX_COLORS];
float dstv[FZ_MAX_COLORS];
int srcn, dstn;
int k, i;
size_t w = src->w;
int h = src->h;
ptrdiff_t d_line_inc = dst->stride - w * dst->n;
ptrdiff_t s_line_inc = src->stride - w * src->n;
int da = dst->alpha;
int sa = src->alpha;
fz_colorspace *ss = src->colorspace;
fz_colorspace *ds = dst->colorspace;
unsigned char *s = src->samples;
unsigned char *d = dst->samples;
if ((int)w < 0 || h < 0)
return;
if (color_params == NULL)
color_params = fz_default_color_params(ctx);
srcn = ss->n;
dstn = ds->n;
assert(src->w == dst->w && src->h == dst->h);
assert(src->n == srcn + sa);
assert(dst->n == dstn + da);
if (d_line_inc == 0 && s_line_inc == 0)
{
w *= h;
h = 1;
}
/* Special case for Lab colorspace (scaling of components to float) */
if ((fz_colorspace_is_lab(ctx, ss) || fz_colorspace_is_lab_icc(ctx, ss)) && srcn == 3)
{
fz_color_converter cc;
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
while (h--)
{
size_t ww = w;
while (ww--)
{
srcv[0] = *s++ / 255.0f * 100;
srcv[1] = *s++ - 128;
srcv[2] = *s++ - 128;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
*d++ = dstv[k] * 255;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
d += d_line_inc;
s += s_line_inc;
}
fz_drop_color_converter(ctx, &cc);
}
/* Brute-force for small images */
else if (w*h < 256)
{
fz_color_converter cc;
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
while (h--)
{
size_t ww = w;
while (ww--)
{
for (k = 0; k < srcn; k++)
srcv[k] = *s++ / 255.0f;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
*d++ = dstv[k] * 255;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
d += d_line_inc;
s += s_line_inc;
}
fz_drop_color_converter(ctx, &cc);
}
/* 1-d lookup table for separation and similar colorspaces */
else if (srcn == 1)
{
unsigned char lookup[FZ_MAX_COLORS * 256];
fz_color_converter cc;
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
for (i = 0; i < 256; i++)
{
srcv[0] = i / 255.0f;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
lookup[i * dstn + k] = dstv[k] * 255;
}
fz_drop_color_converter(ctx, &cc);
while (h--)
{
size_t ww = w;
while (ww--)
{
i = *s++;
for (k = 0; k < dstn; k++)
*d++ = lookup[i * dstn + k];
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
d += d_line_inc;
s += s_line_inc;
}
}
/* Memoize colors using a hash table for the general case */
else
{
fz_hash_table *lookup;
unsigned char *color;
unsigned char dummy = s[0] ^ 255;
unsigned char *sold = &dummy;
unsigned char *dold;
fz_color_converter cc;
lookup = fz_new_hash_table(ctx, 509, srcn, -1, NULL);
fz_find_color_converter(ctx, &cc, NULL, ds, ss, color_params);
fz_try(ctx)
{
while (h--)
{
size_t ww = w;
while (ww--)
{
if (*s == *sold && memcmp(sold,s,srcn) == 0)
{
sold = s;
memcpy(d, dold, dstn);
d += dstn;
s += srcn;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
else
{
sold = s;
dold = d;
color = fz_hash_find(ctx, lookup, s);
if (color)
{
memcpy(d, color, dstn);
s += srcn;
d += dstn;
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
else
{
for (k = 0; k < srcn; k++)
srcv[k] = *s++ / 255.0f;
cc.convert(ctx, &cc, dstv, srcv);
for (k = 0; k < dstn; k++)
*d++ = dstv[k] * 255;
fz_hash_insert(ctx, lookup, s - srcn, d - dstn);
if (da)
*d++ = (sa ? *s : 255);
s += sa;
}
}
}
d += d_line_inc;
s += s_line_inc;
}
}
fz_always(ctx)
fz_drop_color_converter(ctx, &cc);
fz_catch(ctx)
fz_rethrow(ctx);
fz_drop_hash_table(ctx, lookup);
}
}
|
@@ -3663,6 +3663,7 @@ void fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_
fz_drop_color_converter(ctx, &cached->base);
fz_drop_hash_table(ctx, cached->hash);
fz_free(ctx, cached);
+ cc->opaque = NULL;
fz_rethrow(ctx);
}
}
|
CWE-20
| null | null |
331
|
check_splay(cmap_splay *tree, unsigned int node, int depth)
{
if (node == EMPTY)
return;
assert(tree[node].parent == EMPTY);
walk_splay(tree, node, do_check, tree);
}
|
DoS Exec Code
| 0
|
check_splay(cmap_splay *tree, unsigned int node, int depth)
{
if (node == EMPTY)
return;
assert(tree[node].parent == EMPTY);
walk_splay(tree, node, do_check, tree);
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
332
|
copy_node_types(cmap_splay *node, void *arg)
{
pdf_cmap *cmap = (pdf_cmap *)arg;
if (node->many)
{
assert(node->low == node->high);
cmap->mranges[cmap->mlen].low = node->low;
cmap->mranges[cmap->mlen].out = node->out;
cmap->mlen++;
}
else if (node->low <= 0xffff && node->high <= 0xFFFF && node->out <= 0xFFFF)
{
cmap->ranges[cmap->rlen].low = node->low;
cmap->ranges[cmap->rlen].high = node->high;
cmap->ranges[cmap->rlen].out = node->out;
cmap->rlen++;
}
else
{
cmap->xranges[cmap->xlen].low = node->low;
cmap->xranges[cmap->xlen].high = node->high;
cmap->xranges[cmap->xlen].out = node->out;
cmap->xlen++;
}
}
|
DoS Exec Code
| 0
|
copy_node_types(cmap_splay *node, void *arg)
{
pdf_cmap *cmap = (pdf_cmap *)arg;
if (node->many)
{
assert(node->low == node->high);
cmap->mranges[cmap->mlen].low = node->low;
cmap->mranges[cmap->mlen].out = node->out;
cmap->mlen++;
}
else if (node->low <= 0xffff && node->high <= 0xFFFF && node->out <= 0xFFFF)
{
cmap->ranges[cmap->rlen].low = node->low;
cmap->ranges[cmap->rlen].high = node->high;
cmap->ranges[cmap->rlen].out = node->out;
cmap->rlen++;
}
else
{
cmap->xranges[cmap->xlen].low = node->low;
cmap->xranges[cmap->xlen].high = node->high;
cmap->xranges[cmap->xlen].out = node->out;
cmap->xlen++;
}
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
333
|
count_node_types(cmap_splay *node, void *arg)
{
int *counts = (int *)arg;
if (node->many)
counts[2]++;
else if (node->low <= 0xffff && node->high <= 0xFFFF && node->out <= 0xFFFF)
counts[0]++;
else
counts[1]++;
}
|
DoS Exec Code
| 0
|
count_node_types(cmap_splay *node, void *arg)
{
int *counts = (int *)arg;
if (node->many)
counts[2]++;
else if (node->low <= 0xffff && node->high <= 0xFFFF && node->out <= 0xFFFF)
counts[0]++;
else
counts[1]++;
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
334
|
do_check(cmap_splay *node, void *arg)
{
cmap_splay *tree = arg;
unsigned int num = node - tree;
assert(!node->many || node->low == node->high);
assert(node->low <= node->high);
assert((node->left == EMPTY) || (tree[node->left].parent == num &&
tree[node->left].high < node->low));
assert(node->right == EMPTY || (tree[node->right].parent == num &&
node->high < tree[node->right].low));
}
|
DoS Exec Code
| 0
|
do_check(cmap_splay *node, void *arg)
{
cmap_splay *tree = arg;
unsigned int num = node - tree;
assert(!node->many || node->low == node->high);
assert(node->low <= node->high);
assert((node->left == EMPTY) || (tree[node->left].parent == num &&
tree[node->left].high < node->low));
assert(node->right == EMPTY || (tree[node->right].parent == num &&
node->high < tree[node->right].low));
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
335
|
dump_splay(cmap_splay *tree, unsigned int node, int depth, const char *pre)
{
int i;
if (node == EMPTY)
return;
for (i = 0; i < depth; i++)
fprintf(stderr, " ");
fprintf(stderr, "%s%d:", pre, node);
if (tree[node].parent == EMPTY)
fprintf(stderr, "^EMPTY");
else
fprintf(stderr, "^%d", tree[node].parent);
if (tree[node].left == EMPTY)
fprintf(stderr, "<EMPTY");
else
fprintf(stderr, "<%d", tree[node].left);
if (tree[node].right == EMPTY)
fprintf(stderr, ">EMPTY");
else
fprintf(stderr, ">%d", tree[node].right);
fprintf(stderr, "(%x,%x,%x,%d)\n", tree[node].low, tree[node].high, tree[node].out, tree[node].many);
assert(tree[node].parent == EMPTY || depth);
assert(tree[node].left == EMPTY || tree[tree[node].left].parent == node);
assert(tree[node].right == EMPTY || tree[tree[node].right].parent == node);
dump_splay(tree, tree[node].left, depth+1, "L");
dump_splay(tree, tree[node].right, depth+1, "R");
}
|
DoS Exec Code
| 0
|
dump_splay(cmap_splay *tree, unsigned int node, int depth, const char *pre)
{
int i;
if (node == EMPTY)
return;
for (i = 0; i < depth; i++)
fprintf(stderr, " ");
fprintf(stderr, "%s%d:", pre, node);
if (tree[node].parent == EMPTY)
fprintf(stderr, "^EMPTY");
else
fprintf(stderr, "^%d", tree[node].parent);
if (tree[node].left == EMPTY)
fprintf(stderr, "<EMPTY");
else
fprintf(stderr, "<%d", tree[node].left);
if (tree[node].right == EMPTY)
fprintf(stderr, ">EMPTY");
else
fprintf(stderr, ">%d", tree[node].right);
fprintf(stderr, "(%x,%x,%x,%d)\n", tree[node].low, tree[node].high, tree[node].out, tree[node].many);
assert(tree[node].parent == EMPTY || depth);
assert(tree[node].left == EMPTY || tree[tree[node].left].parent == node);
assert(tree[node].right == EMPTY || tree[tree[node].right].parent == node);
dump_splay(tree, tree[node].left, depth+1, "L");
dump_splay(tree, tree[node].right, depth+1, "R");
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
336
|
move_to_root(cmap_splay *tree, unsigned int x)
{
if (x == EMPTY)
return;
do
{
unsigned int z, zp;
unsigned int y = tree[x].parent;
if (y == EMPTY)
break;
z = tree[y].parent;
if (z == EMPTY)
{
/* Case 3 */
tree[x].parent = EMPTY;
tree[y].parent = x;
if (tree[y].left == x)
{
/* Case 3 */
tree[y].left = tree[x].right;
if (tree[y].left != EMPTY)
tree[tree[y].left].parent = y;
tree[x].right = y;
}
else
{
/* Case 3 - reflected */
assert(tree[y].right == x);
tree[y].right = tree[x].left;
if (tree[y].right != EMPTY)
tree[tree[y].right].parent = y;
tree[x].left = y;
}
break;
}
zp = tree[z].parent;
tree[x].parent = zp;
if (zp != EMPTY) {
if (tree[zp].left == z)
tree[zp].left = x;
else
{
assert(tree[zp].right == z);
tree[zp].right = x;
}
}
tree[y].parent = x;
if (tree[y].left == x)
{
tree[y].left = tree[x].right;
if (tree[y].left != EMPTY)
tree[tree[y].left].parent = y;
tree[x].right = y;
if (tree[z].left == y)
{
/* Case 1 */
tree[z].parent = y;
tree[z].left = tree[y].right;
if (tree[z].left != EMPTY)
tree[tree[z].left].parent = z;
tree[y].right = z;
}
else
{
/* Case 2 - reflected */
assert(tree[z].right == y);
tree[z].parent = x;
tree[z].right = tree[x].left;
if (tree[z].right != EMPTY)
tree[tree[z].right].parent = z;
tree[x].left = z;
}
}
else
{
assert(tree[y].right == x);
tree[y].right = tree[x].left;
if (tree[y].right != EMPTY)
tree[tree[y].right].parent = y;
tree[x].left = y;
if (tree[z].left == y)
{
/* Case 2 */
tree[z].parent = x;
tree[z].left = tree[x].right;
if (tree[z].left != EMPTY)
tree[tree[z].left].parent = z;
tree[x].right = z;
}
else
{
/* Case 1 - reflected */
assert(tree[z].right == y);
tree[z].parent = y;
tree[z].right = tree[y].left;
if (tree[z].right != EMPTY)
tree[tree[z].right].parent = z;
tree[y].left = z;
}
}
} while (1);
}
|
DoS Exec Code
| 0
|
move_to_root(cmap_splay *tree, unsigned int x)
{
if (x == EMPTY)
return;
do
{
unsigned int z, zp;
unsigned int y = tree[x].parent;
if (y == EMPTY)
break;
z = tree[y].parent;
if (z == EMPTY)
{
/* Case 3 */
tree[x].parent = EMPTY;
tree[y].parent = x;
if (tree[y].left == x)
{
/* Case 3 */
tree[y].left = tree[x].right;
if (tree[y].left != EMPTY)
tree[tree[y].left].parent = y;
tree[x].right = y;
}
else
{
/* Case 3 - reflected */
assert(tree[y].right == x);
tree[y].right = tree[x].left;
if (tree[y].right != EMPTY)
tree[tree[y].right].parent = y;
tree[x].left = y;
}
break;
}
zp = tree[z].parent;
tree[x].parent = zp;
if (zp != EMPTY) {
if (tree[zp].left == z)
tree[zp].left = x;
else
{
assert(tree[zp].right == z);
tree[zp].right = x;
}
}
tree[y].parent = x;
if (tree[y].left == x)
{
tree[y].left = tree[x].right;
if (tree[y].left != EMPTY)
tree[tree[y].left].parent = y;
tree[x].right = y;
if (tree[z].left == y)
{
/* Case 1 */
tree[z].parent = y;
tree[z].left = tree[y].right;
if (tree[z].left != EMPTY)
tree[tree[z].left].parent = z;
tree[y].right = z;
}
else
{
/* Case 2 - reflected */
assert(tree[z].right == y);
tree[z].parent = x;
tree[z].right = tree[x].left;
if (tree[z].right != EMPTY)
tree[tree[z].right].parent = z;
tree[x].left = z;
}
}
else
{
assert(tree[y].right == x);
tree[y].right = tree[x].left;
if (tree[y].right != EMPTY)
tree[tree[y].right].parent = y;
tree[x].left = y;
if (tree[z].left == y)
{
/* Case 2 */
tree[z].parent = x;
tree[z].left = tree[x].right;
if (tree[z].left != EMPTY)
tree[tree[z].left].parent = z;
tree[x].right = z;
}
else
{
/* Case 1 - reflected */
assert(tree[z].right == y);
tree[z].parent = y;
tree[z].right = tree[y].left;
if (tree[z].right != EMPTY)
tree[tree[z].right].parent = z;
tree[y].left = z;
}
}
} while (1);
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
337
|
pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap)
{
return cmap->wmode;
}
|
DoS Exec Code
| 0
|
pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap)
{
return cmap->wmode;
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
338
|
pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, unsigned char *end, unsigned int *cpt)
{
unsigned int c;
int k, n;
int len = end - buf;
if (len > 4)
len = 4;
c = 0;
for (n = 0; n < len; n++)
{
c = (c << 8) | buf[n];
for (k = 0; k < cmap->codespace_len; k++)
{
if (cmap->codespace[k].n == n + 1)
{
if (c >= cmap->codespace[k].low && c <= cmap->codespace[k].high)
{
*cpt = c;
return n + 1;
}
}
}
}
*cpt = 0;
return 1;
}
|
DoS Exec Code
| 0
|
pdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, unsigned char *end, unsigned int *cpt)
{
unsigned int c;
int k, n;
int len = end - buf;
if (len > 4)
len = 4;
c = 0;
for (n = 0; n < len; n++)
{
c = (c << 8) | buf[n];
for (k = 0; k < cmap->codespace_len; k++)
{
if (cmap->codespace[k].n == n + 1)
{
if (c >= cmap->codespace[k].low && c <= cmap->codespace[k].high)
{
*cpt = c;
return n + 1;
}
}
}
}
*cpt = 0;
return 1;
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
339
|
pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap)
{
fz_drop_storable(ctx, &cmap->storable);
}
|
DoS Exec Code
| 0
|
pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap)
{
fz_drop_storable(ctx, &cmap->storable);
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
340
|
pdf_drop_cmap_imp(fz_context *ctx, fz_storable *cmap_)
{
pdf_cmap *cmap = (pdf_cmap *)cmap_;
pdf_drop_cmap(ctx, cmap->usecmap);
fz_free(ctx, cmap->ranges);
fz_free(ctx, cmap->xranges);
fz_free(ctx, cmap->mranges);
fz_free(ctx, cmap->dict);
fz_free(ctx, cmap->tree);
fz_free(ctx, cmap);
}
|
DoS Exec Code
| 0
|
pdf_drop_cmap_imp(fz_context *ctx, fz_storable *cmap_)
{
pdf_cmap *cmap = (pdf_cmap *)cmap_;
pdf_drop_cmap(ctx, cmap->usecmap);
fz_free(ctx, cmap->ranges);
fz_free(ctx, cmap->xranges);
fz_free(ctx, cmap->mranges);
fz_free(ctx, cmap->dict);
fz_free(ctx, cmap->tree);
fz_free(ctx, cmap);
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
341
|
pdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap)
{
return fz_keep_storable(ctx, &cmap->storable);
}
|
DoS Exec Code
| 0
|
pdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap)
{
return fz_keep_storable(ctx, &cmap->storable);
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
342
|
pdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt)
{
pdf_range *ranges = cmap->ranges;
pdf_xrange *xranges = cmap->xranges;
int l, r, m;
l = 0;
r = cmap->rlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < ranges[m].low)
r = m - 1;
else if (cpt > ranges[m].high)
l = m + 1;
else
return cpt - ranges[m].low + ranges[m].out;
}
l = 0;
r = cmap->xlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < xranges[m].low)
r = m - 1;
else if (cpt > xranges[m].high)
l = m + 1;
else
return cpt - xranges[m].low + xranges[m].out;
}
if (cmap->usecmap)
return pdf_lookup_cmap(cmap->usecmap, cpt);
return -1;
}
|
DoS Exec Code
| 0
|
pdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt)
{
pdf_range *ranges = cmap->ranges;
pdf_xrange *xranges = cmap->xranges;
int l, r, m;
l = 0;
r = cmap->rlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < ranges[m].low)
r = m - 1;
else if (cpt > ranges[m].high)
l = m + 1;
else
return cpt - ranges[m].low + ranges[m].out;
}
l = 0;
r = cmap->xlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < xranges[m].low)
r = m - 1;
else if (cpt > xranges[m].high)
l = m + 1;
else
return cpt - xranges[m].low + xranges[m].out;
}
if (cmap->usecmap)
return pdf_lookup_cmap(cmap->usecmap, cpt);
return -1;
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
343
|
pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out)
{
pdf_range *ranges = cmap->ranges;
pdf_xrange *xranges = cmap->xranges;
pdf_mrange *mranges = cmap->mranges;
unsigned int i;
int l, r, m;
l = 0;
r = cmap->rlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < ranges[m].low)
r = m - 1;
else if (cpt > ranges[m].high)
l = m + 1;
else
{
out[0] = cpt - ranges[m].low + ranges[m].out;
return 1;
}
}
l = 0;
r = cmap->xlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < xranges[m].low)
r = m - 1;
else if (cpt > xranges[m].high)
l = m + 1;
else
{
out[0] = cpt - xranges[m].low + xranges[m].out;
return 1;
}
}
l = 0;
r = cmap->mlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < mranges[m].low)
r = m - 1;
else if (cpt > mranges[m].low)
l = m + 1;
else
{
int *ptr = &cmap->dict[cmap->mranges[m].out];
unsigned int len = (unsigned int)*ptr++;
for (i = 0; i < len; ++i)
out[i] = *ptr++;
return len;
}
}
if (cmap->usecmap)
return pdf_lookup_cmap_full(cmap->usecmap, cpt, out);
return 0;
}
|
DoS Exec Code
| 0
|
pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out)
{
pdf_range *ranges = cmap->ranges;
pdf_xrange *xranges = cmap->xranges;
pdf_mrange *mranges = cmap->mranges;
unsigned int i;
int l, r, m;
l = 0;
r = cmap->rlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < ranges[m].low)
r = m - 1;
else if (cpt > ranges[m].high)
l = m + 1;
else
{
out[0] = cpt - ranges[m].low + ranges[m].out;
return 1;
}
}
l = 0;
r = cmap->xlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < xranges[m].low)
r = m - 1;
else if (cpt > xranges[m].high)
l = m + 1;
else
{
out[0] = cpt - xranges[m].low + xranges[m].out;
return 1;
}
}
l = 0;
r = cmap->mlen - 1;
while (l <= r)
{
m = (l + r) >> 1;
if (cpt < mranges[m].low)
r = m - 1;
else if (cpt > mranges[m].low)
l = m + 1;
else
{
int *ptr = &cmap->dict[cmap->mranges[m].out];
unsigned int len = (unsigned int)*ptr++;
for (i = 0; i < len; ++i)
out[i] = *ptr++;
return len;
}
}
if (cmap->usecmap)
return pdf_lookup_cmap_full(cmap->usecmap, cpt, out);
return 0;
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
344
|
pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *values, int len)
{
if (len == 1)
{
add_range(ctx, cmap, low, low, values[0], 1, 0);
return;
}
/* Decode unicode surrogate pairs. */
/* Only the *-UCS2 CMaps use one-to-many mappings, so assuming unicode should be safe. */
if (len == 2 &&
values[0] >= 0xD800 && values[0] <= 0xDBFF &&
values[1] >= 0xDC00 && values[1] <= 0xDFFF)
{
int rune = ((values[0] - 0xD800) << 10) + (values[1] - 0xDC00) + 0x10000;
add_range(ctx, cmap, low, low, rune, 1, 0);
return;
}
if (len > PDF_MRANGE_CAP)
{
fz_warn(ctx, "ignoring one to many mapping in cmap %s", cmap->cmap_name);
return;
}
add_mrange(ctx, cmap, low, values, len);
}
|
DoS Exec Code
| 0
|
pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *values, int len)
{
if (len == 1)
{
add_range(ctx, cmap, low, low, values[0], 1, 0);
return;
}
/* Decode unicode surrogate pairs. */
/* Only the *-UCS2 CMaps use one-to-many mappings, so assuming unicode should be safe. */
if (len == 2 &&
values[0] >= 0xD800 && values[0] <= 0xDBFF &&
values[1] >= 0xDC00 && values[1] <= 0xDFFF)
{
int rune = ((values[0] - 0xD800) << 10) + (values[1] - 0xDC00) + 0x10000;
add_range(ctx, cmap, low, low, rune, 1, 0);
return;
}
if (len > PDF_MRANGE_CAP)
{
fz_warn(ctx, "ignoring one to many mapping in cmap %s", cmap->cmap_name);
return;
}
add_mrange(ctx, cmap, low, values, len);
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
345
|
pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int out)
{
add_range(ctx, cmap, low, high, out, 1, 0);
}
|
DoS Exec Code
| 0
|
pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int out)
{
add_range(ctx, cmap, low, high, out, 1, 0);
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
346
|
pdf_new_cmap(fz_context *ctx)
{
pdf_cmap *cmap = fz_malloc_struct(ctx, pdf_cmap);
FZ_INIT_STORABLE(cmap, 1, pdf_drop_cmap_imp);
return cmap;
}
|
DoS Exec Code
| 0
|
pdf_new_cmap(fz_context *ctx)
{
pdf_cmap *cmap = fz_malloc_struct(ctx, pdf_cmap);
FZ_INIT_STORABLE(cmap, 1, pdf_drop_cmap_imp);
return cmap;
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
347
|
pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap)
{
int i;
pdf_drop_cmap(ctx, cmap->usecmap);
cmap->usecmap = pdf_keep_cmap(ctx, usecmap);
if (cmap->codespace_len == 0)
{
cmap->codespace_len = usecmap->codespace_len;
for (i = 0; i < usecmap->codespace_len; i++)
cmap->codespace[i] = usecmap->codespace[i];
}
}
|
DoS Exec Code
| 0
|
pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap)
{
int i;
pdf_drop_cmap(ctx, cmap->usecmap);
cmap->usecmap = pdf_keep_cmap(ctx, usecmap);
if (cmap->codespace_len == 0)
{
cmap->codespace_len = usecmap->codespace_len;
for (i = 0; i < usecmap->codespace_len; i++)
cmap->codespace[i] = usecmap->codespace[i];
}
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
348
|
static void walk_splay(cmap_splay *tree, unsigned int node, void (*fn)(cmap_splay *, void *), void *arg)
{
int from = TOP;
while (node != EMPTY)
{
switch (from)
{
case TOP:
if (tree[node].left != EMPTY)
{
node = tree[node].left;
from = TOP;
break;
}
/* fallthrough */
case LEFT:
fn(&tree[node], arg);
if (tree[node].right != EMPTY)
{
node = tree[node].right;
from = TOP;
break;
}
/* fallthrough */
case RIGHT:
{
unsigned int parent = tree[node].parent;
if (parent == EMPTY)
return;
if (tree[parent].left == node)
from = LEFT;
else
{
assert(tree[parent].right == node);
from = RIGHT;
}
node = parent;
}
}
}
}
|
DoS Exec Code
| 0
|
static void walk_splay(cmap_splay *tree, unsigned int node, void (*fn)(cmap_splay *, void *), void *arg)
{
int from = TOP;
while (node != EMPTY)
{
switch (from)
{
case TOP:
if (tree[node].left != EMPTY)
{
node = tree[node].left;
from = TOP;
break;
}
/* fallthrough */
case LEFT:
fn(&tree[node], arg);
if (tree[node].right != EMPTY)
{
node = tree[node].right;
from = TOP;
break;
}
/* fallthrough */
case RIGHT:
{
unsigned int parent = tree[node].parent;
if (parent == EMPTY)
return;
if (tree[parent].left == node)
from = LEFT;
else
{
assert(tree[parent].right == node);
from = RIGHT;
}
node = parent;
}
}
}
}
|
@@ -525,6 +525,7 @@ add_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high,
int new_high = tree[current].high;
tree[current].high = low-1;
add_range(ctx, cmap, high+1, new_high, tree[current].out + high + 1 - tree[current].low, 0, tree[current].many);
+ tree = cmap->tree;
}
/* Now look for where to move to next (left for case 0, right for case 5) */
if (tree[current].low > high) {
|
CWE-416
| null | null |
349
|
end_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
{
pdf_gstate *gstate = pr->gstate + pr->gtop;
if (save->softmask == NULL)
return;
gstate->softmask = save->softmask;
gstate->softmask_resources = save->page_resources;
gstate->softmask_ctm = save->ctm;
fz_pop_clip(ctx, pr->dev);
}
|
DoS Exec Code
| 0
|
end_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
{
pdf_gstate *gstate = pr->gstate + pr->gtop;
if (save->softmask == NULL)
return;
gstate->softmask = save->softmask;
gstate->softmask_resources = save->page_resources;
gstate->softmask_ctm = save->ctm;
fz_pop_clip(ctx, pr->dev);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
350
|
pdf_begin_group(fz_context *ctx, pdf_run_processor *pr, const fz_rect *bbox, softmask_save *softmask)
{
pdf_gstate *gstate = begin_softmask(ctx, pr, softmask);
if (gstate->blendmode)
fz_begin_group(ctx, pr->dev, bbox, NULL, 0, 0, gstate->blendmode, 1);
return pr->gstate + pr->gtop;
}
|
DoS Exec Code
| 0
|
pdf_begin_group(fz_context *ctx, pdf_run_processor *pr, const fz_rect *bbox, softmask_save *softmask)
{
pdf_gstate *gstate = begin_softmask(ctx, pr, softmask);
if (gstate->blendmode)
fz_begin_group(ctx, pr->dev, bbox, NULL, 0, 0, gstate->blendmode, 1);
return pr->gstate + pr->gtop;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
351
|
pdf_copy_gstate(fz_context *ctx, pdf_gstate *gs, pdf_gstate *old)
{
pdf_drop_gstate(ctx, gs);
*gs = *old;
pdf_keep_gstate(ctx, gs);
}
|
DoS Exec Code
| 0
|
pdf_copy_gstate(fz_context *ctx, pdf_gstate *gs, pdf_gstate *old)
{
pdf_drop_gstate(ctx, gs);
*gs = *old;
pdf_keep_gstate(ctx, gs);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
352
|
pdf_copy_pattern_gstate(fz_context *ctx, pdf_gstate *gs, const pdf_gstate *old)
{
gs->ctm = old->ctm;
pdf_drop_font(ctx, gs->text.font);
gs->text.font = pdf_keep_font(ctx, old->text.font);
pdf_drop_xobject(ctx, gs->softmask);
gs->softmask = pdf_keep_xobject(ctx, old->softmask);
fz_drop_stroke_state(ctx, gs->stroke_state);
gs->stroke_state = fz_keep_stroke_state(ctx, old->stroke_state);
}
|
DoS Exec Code
| 0
|
pdf_copy_pattern_gstate(fz_context *ctx, pdf_gstate *gs, const pdf_gstate *old)
{
gs->ctm = old->ctm;
pdf_drop_font(ctx, gs->text.font);
gs->text.font = pdf_keep_font(ctx, old->text.font);
pdf_drop_xobject(ctx, gs->softmask);
gs->softmask = pdf_keep_xobject(ctx, old->softmask);
fz_drop_stroke_state(ctx, gs->stroke_state);
gs->stroke_state = fz_keep_stroke_state(ctx, old->stroke_state);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
353
|
pdf_drop_gstate(fz_context *ctx, pdf_gstate *gs)
{
pdf_drop_material(ctx, &gs->stroke);
pdf_drop_material(ctx, &gs->fill);
pdf_drop_font(ctx, gs->text.font);
pdf_drop_xobject(ctx, gs->softmask);
pdf_drop_obj(ctx, gs->softmask_resources);
fz_drop_stroke_state(ctx, gs->stroke_state);
}
|
DoS Exec Code
| 0
|
pdf_drop_gstate(fz_context *ctx, pdf_gstate *gs)
{
pdf_drop_material(ctx, &gs->stroke);
pdf_drop_material(ctx, &gs->fill);
pdf_drop_font(ctx, gs->text.font);
pdf_drop_xobject(ctx, gs->softmask);
pdf_drop_obj(ctx, gs->softmask_resources);
fz_drop_stroke_state(ctx, gs->stroke_state);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
354
|
pdf_drop_material(fz_context *ctx, pdf_material *mat)
{
fz_drop_colorspace(ctx, mat->colorspace);
pdf_drop_pattern(ctx, mat->pattern);
fz_drop_shade(ctx, mat->shade);
return mat;
}
|
DoS Exec Code
| 0
|
pdf_drop_material(fz_context *ctx, pdf_material *mat)
{
fz_drop_colorspace(ctx, mat->colorspace);
pdf_drop_pattern(ctx, mat->pattern);
fz_drop_shade(ctx, mat->shade);
return mat;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
355
|
pdf_drop_run_processor(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
while (pr->gtop)
pdf_grestore(ctx, pr);
pdf_drop_material(ctx, &pr->gstate[0].fill);
pdf_drop_material(ctx, &pr->gstate[0].stroke);
pdf_drop_font(ctx, pr->gstate[0].text.font);
pdf_drop_xobject(ctx, pr->gstate[0].softmask);
fz_drop_stroke_state(ctx, pr->gstate[0].stroke_state);
while (pr->gstate[0].clip_depth--)
fz_pop_clip(ctx, pr->dev);
fz_drop_path(ctx, pr->path);
fz_drop_text(ctx, pr->tos.text);
fz_drop_default_colorspaces(ctx, pr->default_cs);
fz_free(ctx, pr->gstate);
}
|
DoS Exec Code
| 0
|
pdf_drop_run_processor(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
while (pr->gtop)
pdf_grestore(ctx, pr);
pdf_drop_material(ctx, &pr->gstate[0].fill);
pdf_drop_material(ctx, &pr->gstate[0].stroke);
pdf_drop_font(ctx, pr->gstate[0].text.font);
pdf_drop_xobject(ctx, pr->gstate[0].softmask);
fz_drop_stroke_state(ctx, pr->gstate[0].stroke_state);
while (pr->gstate[0].clip_depth--)
fz_pop_clip(ctx, pr->dev);
fz_drop_path(ctx, pr->path);
fz_drop_text(ctx, pr->tos.text);
fz_drop_default_colorspaces(ctx, pr->default_cs);
fz_free(ctx, pr->gstate);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
356
|
pdf_grestore(fz_context *ctx, pdf_run_processor *pr)
{
pdf_gstate *gs = pr->gstate + pr->gtop;
int clip_depth = gs->clip_depth;
if (pr->gtop <= pr->gbot)
{
fz_warn(ctx, "gstate underflow in content stream");
return;
}
pdf_drop_gstate(ctx, gs);
pr->gtop --;
gs = pr->gstate + pr->gtop;
while (clip_depth > gs->clip_depth)
{
fz_try(ctx)
{
fz_pop_clip(ctx, pr->dev);
}
fz_catch(ctx)
{
/* Silently swallow the problem - restores must
* never throw! */
}
clip_depth--;
}
}
|
DoS Exec Code
| 0
|
pdf_grestore(fz_context *ctx, pdf_run_processor *pr)
{
pdf_gstate *gs = pr->gstate + pr->gtop;
int clip_depth = gs->clip_depth;
if (pr->gtop <= pr->gbot)
{
fz_warn(ctx, "gstate underflow in content stream");
return;
}
pdf_drop_gstate(ctx, gs);
pr->gtop --;
gs = pr->gstate + pr->gtop;
while (clip_depth > gs->clip_depth)
{
fz_try(ctx)
{
fz_pop_clip(ctx, pr->dev);
}
fz_catch(ctx)
{
/* Silently swallow the problem - restores must
* never throw! */
}
clip_depth--;
}
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
357
|
pdf_gsave(fz_context *ctx, pdf_run_processor *pr)
{
if (pr->gtop == pr->gcap-1)
{
pr->gstate = fz_resize_array(ctx, pr->gstate, pr->gcap*2, sizeof(pdf_gstate));
pr->gcap *= 2;
}
memcpy(&pr->gstate[pr->gtop + 1], &pr->gstate[pr->gtop], sizeof(pdf_gstate));
pr->gtop++;
pdf_keep_gstate(ctx, &pr->gstate[pr->gtop]);
}
|
DoS Exec Code
| 0
|
pdf_gsave(fz_context *ctx, pdf_run_processor *pr)
{
if (pr->gtop == pr->gcap-1)
{
pr->gstate = fz_resize_array(ctx, pr->gstate, pr->gcap*2, sizeof(pdf_gstate));
pr->gcap *= 2;
}
memcpy(&pr->gstate[pr->gtop + 1], &pr->gstate[pr->gtop], sizeof(pdf_gstate));
pr->gtop++;
pdf_keep_gstate(ctx, &pr->gstate[pr->gtop]);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
358
|
pdf_keep_gstate(fz_context *ctx, pdf_gstate *gs)
{
pdf_keep_material(ctx, &gs->stroke);
pdf_keep_material(ctx, &gs->fill);
if (gs->text.font)
pdf_keep_font(ctx, gs->text.font);
if (gs->softmask)
pdf_keep_xobject(ctx, gs->softmask);
if (gs->softmask_resources)
pdf_keep_obj(ctx, gs->softmask_resources);
fz_keep_stroke_state(ctx, gs->stroke_state);
}
|
DoS Exec Code
| 0
|
pdf_keep_gstate(fz_context *ctx, pdf_gstate *gs)
{
pdf_keep_material(ctx, &gs->stroke);
pdf_keep_material(ctx, &gs->fill);
if (gs->text.font)
pdf_keep_font(ctx, gs->text.font);
if (gs->softmask)
pdf_keep_xobject(ctx, gs->softmask);
if (gs->softmask_resources)
pdf_keep_obj(ctx, gs->softmask_resources);
fz_keep_stroke_state(ctx, gs->stroke_state);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
359
|
pdf_keep_material(fz_context *ctx, pdf_material *mat)
{
if (mat->colorspace)
fz_keep_colorspace(ctx, mat->colorspace);
if (mat->pattern)
pdf_keep_pattern(ctx, mat->pattern);
if (mat->shade)
fz_keep_shade(ctx, mat->shade);
return mat;
}
|
DoS Exec Code
| 0
|
pdf_keep_material(fz_context *ctx, pdf_material *mat)
{
if (mat->colorspace)
fz_keep_colorspace(ctx, mat->colorspace);
if (mat->pattern)
pdf_keep_pattern(ctx, mat->pattern);
if (mat->shade)
fz_keep_shade(ctx, mat->shade);
return mat;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
360
|
pdf_new_run_processor(fz_context *ctx, fz_device *dev, const fz_matrix *ctm, const char *usage, pdf_gstate *gstate, int nested, fz_default_colorspaces *default_cs)
{
pdf_run_processor *proc = pdf_new_processor(ctx, sizeof *proc);
{
proc->super.usage = usage;
proc->super.drop_processor = pdf_drop_run_processor;
/* general graphics state */
proc->super.op_w = pdf_run_w;
proc->super.op_j = pdf_run_j;
proc->super.op_J = pdf_run_J;
proc->super.op_M = pdf_run_M;
proc->super.op_d = pdf_run_d;
proc->super.op_ri = pdf_run_ri;
proc->super.op_i = pdf_run_i;
proc->super.op_gs_begin = pdf_run_gs_begin;
proc->super.op_gs_end = pdf_run_gs_end;
/* transparency graphics state */
proc->super.op_gs_BM = pdf_run_gs_BM;
proc->super.op_gs_CA = pdf_run_gs_CA;
proc->super.op_gs_ca = pdf_run_gs_ca;
proc->super.op_gs_SMask = pdf_run_gs_SMask;
/* special graphics state */
proc->super.op_q = pdf_run_q;
proc->super.op_Q = pdf_run_Q;
proc->super.op_cm = pdf_run_cm;
/* path construction */
proc->super.op_m = pdf_run_m;
proc->super.op_l = pdf_run_l;
proc->super.op_c = pdf_run_c;
proc->super.op_v = pdf_run_v;
proc->super.op_y = pdf_run_y;
proc->super.op_h = pdf_run_h;
proc->super.op_re = pdf_run_re;
/* path painting */
proc->super.op_S = pdf_run_S;
proc->super.op_s = pdf_run_s;
proc->super.op_F = pdf_run_F;
proc->super.op_f = pdf_run_f;
proc->super.op_fstar = pdf_run_fstar;
proc->super.op_B = pdf_run_B;
proc->super.op_Bstar = pdf_run_Bstar;
proc->super.op_b = pdf_run_b;
proc->super.op_bstar = pdf_run_bstar;
proc->super.op_n = pdf_run_n;
/* clipping paths */
proc->super.op_W = pdf_run_W;
proc->super.op_Wstar = pdf_run_Wstar;
/* text objects */
proc->super.op_BT = pdf_run_BT;
proc->super.op_ET = pdf_run_ET;
/* text state */
proc->super.op_Tc = pdf_run_Tc;
proc->super.op_Tw = pdf_run_Tw;
proc->super.op_Tz = pdf_run_Tz;
proc->super.op_TL = pdf_run_TL;
proc->super.op_Tf = pdf_run_Tf;
proc->super.op_Tr = pdf_run_Tr;
proc->super.op_Ts = pdf_run_Ts;
/* text positioning */
proc->super.op_Td = pdf_run_Td;
proc->super.op_TD = pdf_run_TD;
proc->super.op_Tm = pdf_run_Tm;
proc->super.op_Tstar = pdf_run_Tstar;
/* text showing */
proc->super.op_TJ = pdf_run_TJ;
proc->super.op_Tj = pdf_run_Tj;
proc->super.op_squote = pdf_run_squote;
proc->super.op_dquote = pdf_run_dquote;
/* type 3 fonts */
proc->super.op_d0 = pdf_run_d0;
proc->super.op_d1 = pdf_run_d1;
/* color */
proc->super.op_CS = pdf_run_CS;
proc->super.op_cs = pdf_run_cs;
proc->super.op_SC_color = pdf_run_SC_color;
proc->super.op_sc_color = pdf_run_sc_color;
proc->super.op_SC_pattern = pdf_run_SC_pattern;
proc->super.op_sc_pattern = pdf_run_sc_pattern;
proc->super.op_SC_shade = pdf_run_SC_shade;
proc->super.op_sc_shade = pdf_run_sc_shade;
proc->super.op_G = pdf_run_G;
proc->super.op_g = pdf_run_g;
proc->super.op_RG = pdf_run_RG;
proc->super.op_rg = pdf_run_rg;
proc->super.op_K = pdf_run_K;
proc->super.op_k = pdf_run_k;
/* shadings, images, xobjects */
proc->super.op_sh = pdf_run_sh;
if (dev->fill_image || dev->fill_image_mask || dev->clip_image_mask)
{
proc->super.op_BI = pdf_run_BI;
proc->super.op_Do_image = pdf_run_Do_image;
}
proc->super.op_Do_form = pdf_run_Do_form;
/* marked content */
proc->super.op_MP = pdf_run_MP;
proc->super.op_DP = pdf_run_DP;
proc->super.op_BMC = pdf_run_BMC;
proc->super.op_BDC = pdf_run_BDC;
proc->super.op_EMC = pdf_run_EMC;
/* compatibility */
proc->super.op_BX = pdf_run_BX;
proc->super.op_EX = pdf_run_EX;
/* extgstate */
proc->super.op_gs_OP = pdf_run_gs_OP;
proc->super.op_gs_op = pdf_run_gs_op;
proc->super.op_gs_OPM = pdf_run_gs_OPM;
proc->super.op_gs_UseBlackPtComp = pdf_run_gs_UseBlackPtComp;
proc->super.op_END = pdf_run_END;
}
proc->dev = dev;
proc->default_cs = fz_keep_default_colorspaces(ctx, default_cs);
proc->nested_depth = nested;
proc->path = NULL;
proc->clip = 0;
proc->clip_even_odd = 0;
proc->tos.text = NULL;
proc->tos.tlm = fz_identity;
proc->tos.tm = fz_identity;
proc->tos.text_mode = 0;
fz_try(ctx)
{
proc->path = fz_new_path(ctx);
proc->gcap = 64;
proc->gstate = fz_malloc_array(ctx, proc->gcap, sizeof(pdf_gstate));
pdf_init_gstate(ctx, &proc->gstate[0], ctm);
if (gstate)
{
pdf_copy_gstate(ctx, &proc->gstate[0], gstate);
proc->gstate[0].clip_depth = 0;
proc->gstate[0].ctm = *ctm;
}
proc->gtop = 0;
proc->gbot = 0;
proc->gparent = 0;
}
fz_catch(ctx)
{
fz_drop_path(ctx, proc->path);
fz_free(ctx, proc);
fz_rethrow(ctx);
}
/* We need to save an extra level to allow for level 0 to be the parent gstate level. */
pdf_gsave(ctx, proc);
return (pdf_processor*)proc;
}
|
DoS Exec Code
| 0
|
pdf_new_run_processor(fz_context *ctx, fz_device *dev, const fz_matrix *ctm, const char *usage, pdf_gstate *gstate, int nested, fz_default_colorspaces *default_cs)
{
pdf_run_processor *proc = pdf_new_processor(ctx, sizeof *proc);
{
proc->super.usage = usage;
proc->super.drop_processor = pdf_drop_run_processor;
/* general graphics state */
proc->super.op_w = pdf_run_w;
proc->super.op_j = pdf_run_j;
proc->super.op_J = pdf_run_J;
proc->super.op_M = pdf_run_M;
proc->super.op_d = pdf_run_d;
proc->super.op_ri = pdf_run_ri;
proc->super.op_i = pdf_run_i;
proc->super.op_gs_begin = pdf_run_gs_begin;
proc->super.op_gs_end = pdf_run_gs_end;
/* transparency graphics state */
proc->super.op_gs_BM = pdf_run_gs_BM;
proc->super.op_gs_CA = pdf_run_gs_CA;
proc->super.op_gs_ca = pdf_run_gs_ca;
proc->super.op_gs_SMask = pdf_run_gs_SMask;
/* special graphics state */
proc->super.op_q = pdf_run_q;
proc->super.op_Q = pdf_run_Q;
proc->super.op_cm = pdf_run_cm;
/* path construction */
proc->super.op_m = pdf_run_m;
proc->super.op_l = pdf_run_l;
proc->super.op_c = pdf_run_c;
proc->super.op_v = pdf_run_v;
proc->super.op_y = pdf_run_y;
proc->super.op_h = pdf_run_h;
proc->super.op_re = pdf_run_re;
/* path painting */
proc->super.op_S = pdf_run_S;
proc->super.op_s = pdf_run_s;
proc->super.op_F = pdf_run_F;
proc->super.op_f = pdf_run_f;
proc->super.op_fstar = pdf_run_fstar;
proc->super.op_B = pdf_run_B;
proc->super.op_Bstar = pdf_run_Bstar;
proc->super.op_b = pdf_run_b;
proc->super.op_bstar = pdf_run_bstar;
proc->super.op_n = pdf_run_n;
/* clipping paths */
proc->super.op_W = pdf_run_W;
proc->super.op_Wstar = pdf_run_Wstar;
/* text objects */
proc->super.op_BT = pdf_run_BT;
proc->super.op_ET = pdf_run_ET;
/* text state */
proc->super.op_Tc = pdf_run_Tc;
proc->super.op_Tw = pdf_run_Tw;
proc->super.op_Tz = pdf_run_Tz;
proc->super.op_TL = pdf_run_TL;
proc->super.op_Tf = pdf_run_Tf;
proc->super.op_Tr = pdf_run_Tr;
proc->super.op_Ts = pdf_run_Ts;
/* text positioning */
proc->super.op_Td = pdf_run_Td;
proc->super.op_TD = pdf_run_TD;
proc->super.op_Tm = pdf_run_Tm;
proc->super.op_Tstar = pdf_run_Tstar;
/* text showing */
proc->super.op_TJ = pdf_run_TJ;
proc->super.op_Tj = pdf_run_Tj;
proc->super.op_squote = pdf_run_squote;
proc->super.op_dquote = pdf_run_dquote;
/* type 3 fonts */
proc->super.op_d0 = pdf_run_d0;
proc->super.op_d1 = pdf_run_d1;
/* color */
proc->super.op_CS = pdf_run_CS;
proc->super.op_cs = pdf_run_cs;
proc->super.op_SC_color = pdf_run_SC_color;
proc->super.op_sc_color = pdf_run_sc_color;
proc->super.op_SC_pattern = pdf_run_SC_pattern;
proc->super.op_sc_pattern = pdf_run_sc_pattern;
proc->super.op_SC_shade = pdf_run_SC_shade;
proc->super.op_sc_shade = pdf_run_sc_shade;
proc->super.op_G = pdf_run_G;
proc->super.op_g = pdf_run_g;
proc->super.op_RG = pdf_run_RG;
proc->super.op_rg = pdf_run_rg;
proc->super.op_K = pdf_run_K;
proc->super.op_k = pdf_run_k;
/* shadings, images, xobjects */
proc->super.op_sh = pdf_run_sh;
if (dev->fill_image || dev->fill_image_mask || dev->clip_image_mask)
{
proc->super.op_BI = pdf_run_BI;
proc->super.op_Do_image = pdf_run_Do_image;
}
proc->super.op_Do_form = pdf_run_Do_form;
/* marked content */
proc->super.op_MP = pdf_run_MP;
proc->super.op_DP = pdf_run_DP;
proc->super.op_BMC = pdf_run_BMC;
proc->super.op_BDC = pdf_run_BDC;
proc->super.op_EMC = pdf_run_EMC;
/* compatibility */
proc->super.op_BX = pdf_run_BX;
proc->super.op_EX = pdf_run_EX;
/* extgstate */
proc->super.op_gs_OP = pdf_run_gs_OP;
proc->super.op_gs_op = pdf_run_gs_op;
proc->super.op_gs_OPM = pdf_run_gs_OPM;
proc->super.op_gs_UseBlackPtComp = pdf_run_gs_UseBlackPtComp;
proc->super.op_END = pdf_run_END;
}
proc->dev = dev;
proc->default_cs = fz_keep_default_colorspaces(ctx, default_cs);
proc->nested_depth = nested;
proc->path = NULL;
proc->clip = 0;
proc->clip_even_odd = 0;
proc->tos.text = NULL;
proc->tos.tlm = fz_identity;
proc->tos.tm = fz_identity;
proc->tos.text_mode = 0;
fz_try(ctx)
{
proc->path = fz_new_path(ctx);
proc->gcap = 64;
proc->gstate = fz_malloc_array(ctx, proc->gcap, sizeof(pdf_gstate));
pdf_init_gstate(ctx, &proc->gstate[0], ctm);
if (gstate)
{
pdf_copy_gstate(ctx, &proc->gstate[0], gstate);
proc->gstate[0].clip_depth = 0;
proc->gstate[0].ctm = *ctm;
}
proc->gtop = 0;
proc->gbot = 0;
proc->gparent = 0;
}
fz_catch(ctx)
{
fz_drop_path(ctx, proc->path);
fz_free(ctx, proc);
fz_rethrow(ctx);
}
/* We need to save an extra level to allow for level 0 to be the parent gstate level. */
pdf_gsave(ctx, proc);
return (pdf_processor*)proc;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
361
|
static void pdf_run_B(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 1, 1, 0);
}
|
DoS Exec Code
| 0
|
static void pdf_run_B(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 1, 1, 0);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
362
|
static void pdf_run_BDC(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked)
{
}
|
DoS Exec Code
| 0
|
static void pdf_run_BDC(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked)
{
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
363
|
static void pdf_run_BI(fz_context *ctx, pdf_processor *proc, fz_image *image)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_image(ctx, pr, image);
}
|
DoS Exec Code
| 0
|
static void pdf_run_BI(fz_context *ctx, pdf_processor *proc, fz_image *image)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_image(ctx, pr, image);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
364
|
static void pdf_run_BT(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->tos.tm = fz_identity;
pr->tos.tlm = fz_identity;
}
|
DoS Exec Code
| 0
|
static void pdf_run_BT(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->tos.tm = fz_identity;
pr->tos.tlm = fz_identity;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
365
|
static void pdf_run_BX(fz_context *ctx, pdf_processor *proc)
{
}
|
DoS Exec Code
| 0
|
static void pdf_run_BX(fz_context *ctx, pdf_processor *proc)
{
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
366
|
static void pdf_run_Bstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 1, 1, 1);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Bstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 1, 1, 1);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
367
|
static void pdf_run_CS(fz_context *ctx, pdf_processor *proc, const char *name, fz_colorspace *colorspace)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
if (!strcmp(name, "Pattern"))
pdf_set_pattern(ctx, pr, PDF_STROKE, NULL, NULL);
else
pdf_set_colorspace(ctx, pr, PDF_STROKE, colorspace);
}
|
DoS Exec Code
| 0
|
static void pdf_run_CS(fz_context *ctx, pdf_processor *proc, const char *name, fz_colorspace *colorspace)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
if (!strcmp(name, "Pattern"))
pdf_set_pattern(ctx, pr, PDF_STROKE, NULL, NULL);
else
pdf_set_colorspace(ctx, pr, PDF_STROKE, colorspace);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
368
|
static void pdf_run_DP(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked)
{
}
|
DoS Exec Code
| 0
|
static void pdf_run_DP(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked)
{
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
369
|
static void pdf_run_Do_form(fz_context *ctx, pdf_processor *proc, const char *name, pdf_xobject *xobj, pdf_obj *page_resources)
{
pdf_run_xobject(ctx, (pdf_run_processor*)proc, xobj, page_resources, &fz_identity, 0);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Do_form(fz_context *ctx, pdf_processor *proc, const char *name, pdf_xobject *xobj, pdf_obj *page_resources)
{
pdf_run_xobject(ctx, (pdf_run_processor*)proc, xobj, page_resources, &fz_identity, 0);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
370
|
static void pdf_run_Do_image(fz_context *ctx, pdf_processor *proc, const char *name, fz_image *image)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_image(ctx, pr, image);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Do_image(fz_context *ctx, pdf_processor *proc, const char *name, fz_image *image)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_image(ctx, pr, image);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
371
|
static void pdf_run_EMC(fz_context *ctx, pdf_processor *proc)
{
}
|
DoS Exec Code
| 0
|
static void pdf_run_EMC(fz_context *ctx, pdf_processor *proc)
{
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
372
|
static void pdf_run_END(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_flush_text(ctx, pr);
}
|
DoS Exec Code
| 0
|
static void pdf_run_END(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_flush_text(ctx, pr);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
373
|
static void pdf_run_ET(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_flush_text(ctx, pr);
}
|
DoS Exec Code
| 0
|
static void pdf_run_ET(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_flush_text(ctx, pr);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
374
|
static void pdf_run_EX(fz_context *ctx, pdf_processor *proc)
{
}
|
DoS Exec Code
| 0
|
static void pdf_run_EX(fz_context *ctx, pdf_processor *proc)
{
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
375
|
static void pdf_run_F(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 1, 0, 0);
}
|
DoS Exec Code
| 0
|
static void pdf_run_F(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 1, 0, 0);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
376
|
static void pdf_run_G(fz_context *ctx, pdf_processor *proc, float g)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_colorspace(ctx, pr, PDF_STROKE, fz_device_gray(ctx));
pdf_set_color(ctx, pr, PDF_STROKE, &g);
}
|
DoS Exec Code
| 0
|
static void pdf_run_G(fz_context *ctx, pdf_processor *proc, float g)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_colorspace(ctx, pr, PDF_STROKE, fz_device_gray(ctx));
pdf_set_color(ctx, pr, PDF_STROKE, &g);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
377
|
static void pdf_run_J(fz_context *ctx, pdf_processor *proc, int linecap)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pdf_flush_text(ctx, pr);
pr->dev->flags &= ~(FZ_DEVFLAG_STARTCAP_UNDEFINED | FZ_DEVFLAG_DASHCAP_UNDEFINED | FZ_DEVFLAG_ENDCAP_UNDEFINED);
gstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);
gstate->stroke_state->start_cap = linecap;
gstate->stroke_state->dash_cap = linecap;
gstate->stroke_state->end_cap = linecap;
}
|
DoS Exec Code
| 0
|
static void pdf_run_J(fz_context *ctx, pdf_processor *proc, int linecap)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pdf_flush_text(ctx, pr);
pr->dev->flags &= ~(FZ_DEVFLAG_STARTCAP_UNDEFINED | FZ_DEVFLAG_DASHCAP_UNDEFINED | FZ_DEVFLAG_ENDCAP_UNDEFINED);
gstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);
gstate->stroke_state->start_cap = linecap;
gstate->stroke_state->dash_cap = linecap;
gstate->stroke_state->end_cap = linecap;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
378
|
static void pdf_run_M(fz_context *ctx, pdf_processor *proc, float miterlimit)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pdf_flush_text(ctx, pr);
pr->dev->flags &= ~FZ_DEVFLAG_MITERLIMIT_UNDEFINED;
gstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);
gstate->stroke_state->miterlimit = miterlimit;
}
|
DoS Exec Code
| 0
|
static void pdf_run_M(fz_context *ctx, pdf_processor *proc, float miterlimit)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pdf_flush_text(ctx, pr);
pr->dev->flags &= ~FZ_DEVFLAG_MITERLIMIT_UNDEFINED;
gstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);
gstate->stroke_state->miterlimit = miterlimit;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
379
|
static void pdf_run_MP(fz_context *ctx, pdf_processor *proc, const char *tag)
{
}
|
DoS Exec Code
| 0
|
static void pdf_run_MP(fz_context *ctx, pdf_processor *proc, const char *tag)
{
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
380
|
static void pdf_run_Q(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_grestore(ctx, pr);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Q(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_grestore(ctx, pr);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
381
|
static void pdf_run_RG(fz_context *ctx, pdf_processor *proc, float r, float g, float b)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
float color[3] = {r, g, b};
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_colorspace(ctx, pr, PDF_STROKE, fz_device_rgb(ctx));
pdf_set_color(ctx, pr, PDF_STROKE, color);
}
|
DoS Exec Code
| 0
|
static void pdf_run_RG(fz_context *ctx, pdf_processor *proc, float r, float g, float b)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
float color[3] = {r, g, b};
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_colorspace(ctx, pr, PDF_STROKE, fz_device_rgb(ctx));
pdf_set_color(ctx, pr, PDF_STROKE, color);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
382
|
static void pdf_run_S(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 0, 1, 0);
}
|
DoS Exec Code
| 0
|
static void pdf_run_S(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 0, 0, 1, 0);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
383
|
static void pdf_run_SC_color(fz_context *ctx, pdf_processor *proc, int n, float *color)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_color(ctx, pr, PDF_STROKE, color);
}
|
DoS Exec Code
| 0
|
static void pdf_run_SC_color(fz_context *ctx, pdf_processor *proc, int n, float *color)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_color(ctx, pr, PDF_STROKE, color);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
384
|
static void pdf_run_SC_pattern(fz_context *ctx, pdf_processor *proc, const char *name, pdf_pattern *pat, int n, float *color)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_pattern(ctx, pr, PDF_STROKE, pat, color);
}
|
DoS Exec Code
| 0
|
static void pdf_run_SC_pattern(fz_context *ctx, pdf_processor *proc, const char *name, pdf_pattern *pat, int n, float *color)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_pattern(ctx, pr, PDF_STROKE, pat, color);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
385
|
static void pdf_run_SC_shade(fz_context *ctx, pdf_processor *proc, const char *name, fz_shade *shade)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_shade(ctx, pr, PDF_STROKE, shade);
}
|
DoS Exec Code
| 0
|
static void pdf_run_SC_shade(fz_context *ctx, pdf_processor *proc, const char *name, fz_shade *shade)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;
pdf_set_shade(ctx, pr, PDF_STROKE, shade);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
386
|
static void pdf_run_TD(fz_context *ctx, pdf_processor *proc, float tx, float ty)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.leading = -ty;
pdf_tos_translate(&pr->tos, tx, ty);
}
|
DoS Exec Code
| 0
|
static void pdf_run_TD(fz_context *ctx, pdf_processor *proc, float tx, float ty)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.leading = -ty;
pdf_tos_translate(&pr->tos, tx, ty);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
387
|
static void pdf_run_TL(fz_context *ctx, pdf_processor *proc, float leading)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.leading = leading;
}
|
DoS Exec Code
| 0
|
static void pdf_run_TL(fz_context *ctx, pdf_processor *proc, float leading)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.leading = leading;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
388
|
static void pdf_run_Tc(fz_context *ctx, pdf_processor *proc, float charspace)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.char_space = charspace;
}
|
DoS Exec Code
| 0
|
static void pdf_run_Tc(fz_context *ctx, pdf_processor *proc, float charspace)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.char_space = charspace;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
389
|
static void pdf_run_Td(fz_context *ctx, pdf_processor *proc, float tx, float ty)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_tos_translate(&pr->tos, tx, ty);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Td(fz_context *ctx, pdf_processor *proc, float tx, float ty)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_tos_translate(&pr->tos, tx, ty);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
390
|
static void pdf_run_Tf(fz_context *ctx, pdf_processor *proc, const char *name, pdf_font_desc *font, float size)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
pdf_drop_font(ctx, gstate->text.font);
gstate->text.font = pdf_keep_font(ctx, font);
gstate->text.size = size;
}
|
DoS Exec Code
| 0
|
static void pdf_run_Tf(fz_context *ctx, pdf_processor *proc, const char *name, pdf_font_desc *font, float size)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
pdf_drop_font(ctx, gstate->text.font);
gstate->text.font = pdf_keep_font(ctx, font);
gstate->text.size = size;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
391
|
static void pdf_run_Tj(fz_context *ctx, pdf_processor *proc, char *string, int string_len)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_string(ctx, pr, (unsigned char *)string, string_len);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Tj(fz_context *ctx, pdf_processor *proc, char *string, int string_len)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_string(ctx, pr, (unsigned char *)string, string_len);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
392
|
static void pdf_run_Tm(fz_context *ctx, pdf_processor *proc, float a, float b, float c, float d, float e, float f)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_tos_set_matrix(&pr->tos, a, b, c, d, e, f);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Tm(fz_context *ctx, pdf_processor *proc, float a, float b, float c, float d, float e, float f)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_tos_set_matrix(&pr->tos, a, b, c, d, e, f);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
393
|
static void pdf_run_Tr(fz_context *ctx, pdf_processor *proc, int render)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.render = render;
}
|
DoS Exec Code
| 0
|
static void pdf_run_Tr(fz_context *ctx, pdf_processor *proc, int render)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.render = render;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
394
|
static void pdf_run_Tstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
pdf_tos_newline(&pr->tos, gstate->text.leading);
}
|
DoS Exec Code
| 0
|
static void pdf_run_Tstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
pdf_tos_newline(&pr->tos, gstate->text.leading);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
395
|
static void pdf_run_Tw(fz_context *ctx, pdf_processor *proc, float wordspace)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.word_space = wordspace;
}
|
DoS Exec Code
| 0
|
static void pdf_run_Tw(fz_context *ctx, pdf_processor *proc, float wordspace)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_gstate *gstate = pr->gstate + pr->gtop;
gstate->text.word_space = wordspace;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
396
|
static void pdf_run_W(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->clip = 1;
pr->clip_even_odd = 0;
}
|
DoS Exec Code
| 0
|
static void pdf_run_W(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->clip = 1;
pr->clip_even_odd = 0;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
397
|
static void pdf_run_Wstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->clip = 1;
pr->clip_even_odd = 1;
}
|
DoS Exec Code
| 0
|
static void pdf_run_Wstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pr->clip = 1;
pr->clip_even_odd = 1;
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
398
|
static void pdf_run_b(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 1, 1, 1, 0);
}
|
DoS Exec Code
| 0
|
static void pdf_run_b(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 1, 1, 1, 0);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
399
|
static void pdf_run_bstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 1, 1, 1, 1);
}
|
DoS Exec Code
| 0
|
static void pdf_run_bstar(fz_context *ctx, pdf_processor *proc)
{
pdf_run_processor *pr = (pdf_run_processor *)proc;
pdf_show_path(ctx, pr, 1, 1, 1, 1);
}
|
@@ -135,7 +135,7 @@ begin_softmask(fz_context *ctx, pdf_run_processor *pr, softmask_save *save)
mask_colorspace = pdf_xobject_colorspace(ctx, softmask);
if (gstate->luminosity && !mask_colorspace)
- mask_colorspace = fz_device_gray(ctx);
+ mask_colorspace = fz_keep_colorspace(ctx, fz_device_gray(ctx));
fz_try(ctx)
{
|
CWE-416
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.