Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Persch
poppler
Commits
d0ab87c1
Commit
d0ab87c1
authored
Nov 12, 2018
by
Albert Astals Cid
Committed by
Albert Astals Cid
Nov 12, 2018
Browse files
Save an incRef/decRef when creating EmbFile
parent
08d4f02c
Changes
2
Hide whitespace changes
Inline
Side-by-side
poppler/FileSpec.cc
View file @
d0ab87c1
...
...
@@ -29,7 +29,7 @@
#include
"FileSpec.h"
EmbFile
::
EmbFile
(
const
Object
*
efStream
)
EmbFile
::
EmbFile
(
Object
&&
efStream
)
{
m_size
=
-
1
;
m_createDate
=
nullptr
;
...
...
@@ -37,11 +37,11 @@ EmbFile::EmbFile(const Object *efStream)
m_checksum
=
nullptr
;
m_mimetype
=
nullptr
;
m_objStr
=
efStream
->
copy
(
);
m_objStr
=
std
::
move
(
efStream
);
if
(
efStream
->
isStream
())
{
if
(
m_objStr
.
isStream
())
{
// dataDict corresponds to Table 3.41 in the PDF1.6 spec.
Dict
*
dataDict
=
efStream
->
streamGetDict
();
Dict
*
dataDict
=
m_objStr
.
streamGetDict
();
// subtype is normally the mimetype
Object
subtypeName
=
dataDict
->
lookup
(
"Subtype"
);
...
...
@@ -156,10 +156,8 @@ EmbFile *FileSpec::getEmbeddedFile()
if
(
embFile
)
return
embFile
;
Object
obj1
;
XRef
*
xref
=
fileSpec
.
getDict
()
->
getXRef
();
obj1
=
fileStream
.
fetch
(
xref
);
embFile
=
new
EmbFile
(
&
obj1
);
embFile
=
new
EmbFile
(
fileStream
.
fetch
(
xref
));
return
embFile
;
}
...
...
poppler/FileSpec.h
View file @
d0ab87c1
...
...
@@ -20,7 +20,7 @@
class
EmbFile
{
public:
EmbFile
(
const
Object
*
efStream
);
EmbFile
(
Object
&&
efStream
);
~
EmbFile
();
EmbFile
(
const
EmbFile
&
)
=
delete
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment