aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pl_ASCIIHexDecoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/Pl_ASCIIHexDecoder.cc')
-rw-r--r--libqpdf/Pl_ASCIIHexDecoder.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libqpdf/Pl_ASCIIHexDecoder.cc b/libqpdf/Pl_ASCIIHexDecoder.cc
index f20a9769..7845268e 100644
--- a/libqpdf/Pl_ASCIIHexDecoder.cc
+++ b/libqpdf/Pl_ASCIIHexDecoder.cc
@@ -97,12 +97,14 @@ Pl_ASCIIHexDecoder::flush()
QTC::TC("libtests", "Pl_ASCIIHexDecoder partial flush",
(this->pos == 2) ? 0 : 1);
- getNext()->write(&ch, 1);
-
+ // Reset before calling getNext()->write in case that throws an
+ // exception.
this->pos = 0;
this->inbuf[0] = '0';
this->inbuf[1] = '0';
this->inbuf[2] = '\0';
+
+ getNext()->write(&ch, 1);
}
void