diff options
Diffstat (limited to 'src/plugins/dvi_extractor.c')
-rw-r--r-- | src/plugins/dvi_extractor.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/plugins/dvi_extractor.c b/src/plugins/dvi_extractor.c index f01ae8f..c759576 100644 --- a/src/plugins/dvi_extractor.c +++ b/src/plugins/dvi_extractor.c | |||
@@ -188,24 +188,20 @@ EXTRACTOR_dvi_extract (const unsigned char *data, | |||
188 | "application/x-dvi", | 188 | "application/x-dvi", |
189 | strlen ("application/x-dvi") +1)) | 189 | strlen ("application/x-dvi") +1)) |
190 | return 1; | 190 | return 1; |
191 | comment = malloc (klen + 1); | 191 | { |
192 | if (comment != NULL) | 192 | char comment[klen + 1]; |
193 | { | 193 | |
194 | comment[klen] = '\0'; | 194 | comment[klen] = '\0'; |
195 | memcpy (comment, &data[15], klen); | 195 | memcpy (comment, &data[15], klen); |
196 | if (0 != proc (proc_cls, | 196 | if (0 != proc (proc_cls, |
197 | "dvi", | 197 | "dvi", |
198 | EXTRACTOR_METATYPE_COMMENT, | 198 | EXTRACTOR_METATYPE_COMMENT, |
199 | EXTRACTOR_METAFORMAT_UTF8, | 199 | EXTRACTOR_METAFORMAT_UTF8, |
200 | "text/plain", | 200 | "text/plain", |
201 | comment, | 201 | comment, |
202 | strlen (comment) +1)) | 202 | klen +1)) |
203 | { | 203 | return 1; |
204 | free (comment); | 204 | } |
205 | return 1; | ||
206 | } | ||
207 | free (comment); | ||
208 | } | ||
209 | /* try to find PDF/ps special */ | 205 | /* try to find PDF/ps special */ |
210 | pos = opos; | 206 | pos = opos; |
211 | while (pos < size - 100) | 207 | while (pos < size - 100) |