Commit 41a450c8 authored by David Benjamin's avatar David Benjamin Committed by Carlos Garcia Campos

[cairo] Avoid leaving pointers to free'd memory

Fixes potential free'd memory access introduced by
3a94e8ce. I don't think this is actually
possible in the current code; we push/pop before and after rendering a
PDF, so the bottom state should never have a mask.

Still, better to clean this up.
parent 30922840
......@@ -272,10 +272,9 @@ void CairoOutputDev::restoreState(GfxState *state) {
updateBlendMode(state);
MaskStack* ms = maskStack;
if (mask)
cairo_pattern_destroy(mask);
if (ms) {
if (mask)
cairo_pattern_destroy(mask);
mask = ms->mask;
maskStack = ms->next;
delete ms;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment