summaryrefslogtreecommitdiff
path: root/poppler/FileSpec.cc
diff options
context:
space:
mode:
authorAdam Reichold <adam.reichold@t-online.de>2018-11-06 09:00:02 +0100
committerAdam Reichold <adam.reichold@t-online.de>2018-11-06 09:00:15 +0100
commit6912e06d9ab19ba28991b5cab3319d61d856bd6d (patch)
tree93f6b2968d4dd026d179e7016cd79c1cab6e8cd5 /poppler/FileSpec.cc
parent6ced3253fa3356e50d6c1dfa8961561eabefb9e8 (diff)
Check for stream before calling stream methods when saving an embedded file.
Closes #659
Diffstat (limited to 'poppler/FileSpec.cc')
-rw-r--r--poppler/FileSpec.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc
index 7479c2d2..d5543041 100644
--- a/poppler/FileSpec.cc
+++ b/poppler/FileSpec.cc
@@ -93,6 +93,9 @@ bool EmbFile::save(const char *path) {
bool EmbFile::save2(FILE *f) {
int c;
+ if (unlikely(!m_objStr.isStream()))
+ return false;
+
m_objStr.streamReset();
while ((c = m_objStr.streamGetChar()) != EOF) {
fputc(c, f);