aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/extractor.h2
-rw-r--r--src/plugins/gif_extractor.c16
-rw-r--r--src/plugins/it_extractor.c6
-rw-r--r--src/plugins/nsfe_extractor.c8
-rw-r--r--src/plugins/s3m_extractor.c2
-rw-r--r--src/plugins/sid_extractor.c24
-rw-r--r--src/plugins/xm_extractor.c8
7 files changed, 34 insertions, 32 deletions
diff --git a/src/include/extractor.h b/src/include/extractor.h
index 0325dc6..782134b 100644
--- a/src/include/extractor.h
+++ b/src/include/extractor.h
@@ -35,7 +35,7 @@ extern "C" {
35 * 0.2.6-1 => 0x00020601 35 * 0.2.6-1 => 0x00020601
36 * 4.5.2-0 => 0x04050200 36 * 4.5.2-0 => 0x04050200
37 */ 37 */
38#define EXTRACTOR_VERSION 0x01060000 38#define EXTRACTOR_VERSION 0x01060001
39 39
40#include <stdio.h> 40#include <stdio.h>
41 41
diff --git a/src/plugins/gif_extractor.c b/src/plugins/gif_extractor.c
index aae2b82..8ee5807 100644
--- a/src/plugins/gif_extractor.c
+++ b/src/plugins/gif_extractor.c
@@ -43,7 +43,7 @@ gif_read_func (GifFileType *ft,
43 struct EXTRACTOR_ExtractContext *ec = ft->UserData; 43 struct EXTRACTOR_ExtractContext *ec = ft->UserData;
44 void *data; 44 void *data;
45 ssize_t ret; 45 ssize_t ret;
46 46
47 ret = ec->read (ec->cls, 47 ret = ec->read (ec->cls,
48 &data, 48 &data,
49 arg); 49 arg);
@@ -55,7 +55,7 @@ gif_read_func (GifFileType *ft,
55 55
56 56
57/** 57/**
58 * Main entry method for the 'image/gif' extraction plugin. 58 * Main entry method for the 'image/gif' extraction plugin.
59 * 59 *
60 * @param ec extraction context provided to the plugin 60 * @param ec extraction context provided to the plugin
61 */ 61 */
@@ -72,7 +72,7 @@ EXTRACTOR_gif_extract_method (struct EXTRACTOR_ExtractContext *ec)
72 return; /* not a GIF */ 72 return; /* not a GIF */
73#else 73#else
74 int gif_error; 74 int gif_error;
75 75
76 gif_error = 0; 76 gif_error = 0;
77 gif_file = DGifOpen (ec, &gif_read_func, &gif_error); 77 gif_file = DGifOpen (ec, &gif_read_func, &gif_error);
78 if (gif_file == NULL || gif_error != 0) 78 if (gif_file == NULL || gif_error != 0)
@@ -97,8 +97,8 @@ EXTRACTOR_gif_extract_method (struct EXTRACTOR_ExtractContext *ec)
97 return; 97 return;
98 snprintf (dims, 98 snprintf (dims,
99 sizeof (dims), 99 sizeof (dims),
100 "%dx%d", 100 "%dx%d",
101 gif_file->SHeight, 101 gif_file->SHeight,
102 gif_file->SWidth); 102 gif_file->SWidth);
103 if (0 != 103 if (0 !=
104 ec->proc (ec->cls, 104 ec->proc (ec->cls,
@@ -111,7 +111,7 @@ EXTRACTOR_gif_extract_method (struct EXTRACTOR_ExtractContext *ec)
111 return; 111 return;
112 while (1) 112 while (1)
113 { 113 {
114 if (GIF_OK != 114 if (GIF_OK !=
115 DGifGetRecordType (gif_file, 115 DGifGetRecordType (gif_file,
116 &gif_type)) 116 &gif_type))
117 break; 117 break;
@@ -122,6 +122,8 @@ EXTRACTOR_gif_extract_method (struct EXTRACTOR_ExtractContext *ec)
122 if (GIF_OK != 122 if (GIF_OK !=
123 DGifGetExtension (gif_file, &et, &ext)) 123 DGifGetExtension (gif_file, &et, &ext))
124 continue; 124 continue;
125 if (NULL == ext)
126 continue;
125 if (COMMENT_EXT_FUNC_CODE == et) 127 if (COMMENT_EXT_FUNC_CODE == et)
126 { 128 {
127 ec->proc (ec->cls, 129 ec->proc (ec->cls,
@@ -133,7 +135,7 @@ EXTRACTOR_gif_extract_method (struct EXTRACTOR_ExtractContext *ec)
133 (uint8_t) ext[0]); 135 (uint8_t) ext[0]);
134 break; 136 break;
135 } 137 }
136 while ( (GIF_ERROR != 138 while ( (GIF_ERROR !=
137 DGifGetExtensionNext(gif_file, &ext)) && 139 DGifGetExtensionNext(gif_file, &ext)) &&
138 (NULL != ext) ) ; /* keep going */ 140 (NULL != ext) ) ; /* keep going */
139 } 141 }
diff --git a/src/plugins/it_extractor.c b/src/plugins/it_extractor.c
index 5b8a136..3d8803f 100644
--- a/src/plugins/it_extractor.c
+++ b/src/plugins/it_extractor.c
@@ -70,7 +70,7 @@ EXTRACTOR_it_extract_method (struct EXTRACTOR_ExtractContext *ec)
70 char itversion[8]; 70 char itversion[8];
71 const struct Header *head; 71 const struct Header *head;
72 72
73 if (HEADER_SIZE > 73 if ((ssize_t) HEADER_SIZE >
74 ec->read (ec->cls, 74 ec->read (ec->cls,
75 &data, 75 &data,
76 HEADER_SIZE)) 76 HEADER_SIZE))
@@ -90,9 +90,9 @@ EXTRACTOR_it_extract_method (struct EXTRACTOR_ExtractContext *ec)
90 return; 90 return;
91 91
92 /* Version of Tracker */ 92 /* Version of Tracker */
93 snprintf (itversion, 93 snprintf (itversion,
94 sizeof (itversion), 94 sizeof (itversion),
95 "%d.%d", 95 "%d.%d",
96 (head->version[0] & 0x01), 96 (head->version[0] & 0x01),
97 head->version[1]); 97 head->version[1]);
98 if (0 != ec->proc (ec->cls, 98 if (0 != ec->proc (ec->cls,
diff --git a/src/plugins/nsfe_extractor.c b/src/plugins/nsfe_extractor.c
index 6a8be86..7369477 100644
--- a/src/plugins/nsfe_extractor.c
+++ b/src/plugins/nsfe_extractor.c
@@ -175,7 +175,7 @@ info_extract (struct EXTRACTOR_ExtractContext *ec,
175 175
176 if (size < 8) 176 if (size < 8)
177 return 0; 177 return 0;
178 if (size > 178 if ((ssize_t) size >
179 ec->read (ec->cls, 179 ec->read (ec->cls,
180 &data, 180 &data,
181 size)) 181 size))
@@ -243,7 +243,7 @@ tlbl_extract (struct EXTRACTOR_ExtractContext *ec,
243 void *data; 243 void *data;
244 const char *cdata; 244 const char *cdata;
245 245
246 if (size > 246 if ((ssize_t) size >
247 ec->read (ec->cls, 247 ec->read (ec->cls,
248 &data, 248 &data,
249 size)) 249 size))
@@ -285,7 +285,7 @@ auth_extract (struct EXTRACTOR_ExtractContext *ec,
285 285
286 if (left < 1) 286 if (left < 1)
287 return 0; 287 return 0;
288 if (size > 288 if ((ssize_t) size >
289 ec->read (ec->cls, 289 ec->read (ec->cls,
290 &data, 290 &data,
291 size)) 291 size))
@@ -342,7 +342,7 @@ EXTRACTOR_nsfe_extract_method (struct EXTRACTOR_ExtractContext *ec)
342 uint32_t chunksize; 342 uint32_t chunksize;
343 int ret; 343 int ret;
344 344
345 if (sizeof (struct header) > 345 if ((ssize_t) sizeof (struct header) >
346 ec->read (ec->cls, 346 ec->read (ec->cls,
347 &data, 347 &data,
348 sizeof (struct header))) 348 sizeof (struct header)))
diff --git a/src/plugins/s3m_extractor.c b/src/plugins/s3m_extractor.c
index 9cd6f8f..c4789ce 100644
--- a/src/plugins/s3m_extractor.c
+++ b/src/plugins/s3m_extractor.c
@@ -80,7 +80,7 @@ EXTRACTOR_s3m_extract_method (struct EXTRACTOR_ExtractContext *ec)
80 struct S3MHeader header; 80 struct S3MHeader header;
81 char song_name_NT[29]; 81 char song_name_NT[29];
82 82
83 if (sizeof (header) > 83 if ((ssize_t) sizeof (header) >
84 ec->read (ec->cls, 84 ec->read (ec->cls,
85 &data, 85 &data,
86 sizeof (header))) 86 sizeof (header)))
diff --git a/src/plugins/sid_extractor.c b/src/plugins/sid_extractor.c
index 571f677..dface42 100644
--- a/src/plugins/sid_extractor.c
+++ b/src/plugins/sid_extractor.c
@@ -116,7 +116,7 @@ struct header
116 /** 116 /**
117 * Flags 117 * Flags
118 */ 118 */
119 sidwrd flags; 119 sidwrd flags;
120 120
121 /** 121 /**
122 * Unknown. 122 * Unknown.
@@ -176,7 +176,7 @@ EXTRACTOR_sid_extract_method (struct EXTRACTOR_ExtractContext *ec)
176 const struct header *head; 176 const struct header *head;
177 void *data; 177 void *data;
178 178
179 if (sizeof (struct header) > 179 if ((ssize_t) sizeof (struct header) >
180 ec->read (ec->cls, 180 ec->read (ec->cls,
181 &data, 181 &data,
182 sizeof (struct header))) 182 sizeof (struct header)))
@@ -193,7 +193,7 @@ EXTRACTOR_sid_extract_method (struct EXTRACTOR_ExtractContext *ec)
193 193
194 /* Version of SID format */ 194 /* Version of SID format */
195 version = sidword (head->sidversion); 195 version = sidword (head->sidversion);
196 snprintf (sidversion, 196 snprintf (sidversion,
197 sizeof (sidversion), 197 sizeof (sidversion),
198 "%d", 198 "%d",
199 version); 199 version);
@@ -208,7 +208,7 @@ EXTRACTOR_sid_extract_method (struct EXTRACTOR_ExtractContext *ec)
208 /* Get number of the first song to be played */ 208 /* Get number of the first song to be played */
209 snprintf (startingsong, 209 snprintf (startingsong,
210 sizeof (startingsong), 210 sizeof (startingsong),
211 "%d", 211 "%d",
212 sidword (head->firstsong)); 212 sidword (head->firstsong));
213 ADD (startingsong, EXTRACTOR_METATYPE_STARTING_SONG); 213 ADD (startingsong, EXTRACTOR_METATYPE_STARTING_SONG);
214 214
@@ -218,9 +218,9 @@ EXTRACTOR_sid_extract_method (struct EXTRACTOR_ExtractContext *ec)
218 ADD (album, EXTRACTOR_METATYPE_ALBUM); 218 ADD (album, EXTRACTOR_METATYPE_ALBUM);
219 219
220 memcpy (&artist, head->artist, 32); 220 memcpy (&artist, head->artist, 32);
221 artist[32] = '\0'; 221 artist[32] = '\0';
222 ADD (artist, EXTRACTOR_METATYPE_ARTIST); 222 ADD (artist, EXTRACTOR_METATYPE_ARTIST);
223 223
224 memcpy (&copyright, head->copyright, 32); 224 memcpy (&copyright, head->copyright, 32);
225 copyright[32] = '\0'; 225 copyright[32] = '\0';
226 ADD (copyright, EXTRACTOR_METATYPE_COPYRIGHT); 226 ADD (copyright, EXTRACTOR_METATYPE_COPYRIGHT);
@@ -236,24 +236,24 @@ EXTRACTOR_sid_extract_method (struct EXTRACTOR_ExtractContext *ec)
236 flags = sidword (head->flags); 236 flags = sidword (head->flags);
237 /* MUS data */ 237 /* MUS data */
238 if (0 != (flags & MUSPLAYER_FLAG)) 238 if (0 != (flags & MUSPLAYER_FLAG))
239 ADD ("Compute!'s Sidplayer", EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE); 239 ADD ("Compute!'s Sidplayer", EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE);
240 240
241 /* PlaySID data */ 241 /* PlaySID data */
242 if (0 != (flags & PLAYSID_FLAG)) 242 if (0 != (flags & PLAYSID_FLAG))
243 ADD ("PlaySID", EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE); 243 ADD ("PlaySID", EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE);
244 244
245 245
246 /* PAL or NTSC */ 246 /* PAL or NTSC */
247 if (0 != (flags & NTSC_FLAG)) 247 if (0 != (flags & NTSC_FLAG))
248 ADD ("PAL/NTSC", EXTRACTOR_METATYPE_BROADCAST_TELEVISION_SYSTEM); 248 ADD ("PAL/NTSC", EXTRACTOR_METATYPE_BROADCAST_TELEVISION_SYSTEM);
249 else if (0 != (flags & PAL_FLAG)) 249 else if (0 != (flags & PAL_FLAG))
250 ADD ("PAL", EXTRACTOR_METATYPE_BROADCAST_TELEVISION_SYSTEM); 250 ADD ("PAL", EXTRACTOR_METATYPE_BROADCAST_TELEVISION_SYSTEM);
251 251
252 /* Detect SID Chips suitable for play the files */ 252 /* Detect SID Chips suitable for play the files */
253 if (0 != (flags & MOS8580_FLAG)) 253 if (0 != (flags & MOS8580_FLAG))
254 ADD ("MOS6581/MOS8580", EXTRACTOR_METATYPE_TARGET_ARCHITECTURE); 254 ADD ("MOS6581/MOS8580", EXTRACTOR_METATYPE_TARGET_ARCHITECTURE);
255 else if (0 != (flags & MOS6581_FLAG)) 255 else if (0 != (flags & MOS6581_FLAG))
256 ADD ("MOS6581", EXTRACTOR_METATYPE_TARGET_ARCHITECTURE); 256 ADD ("MOS6581", EXTRACTOR_METATYPE_TARGET_ARCHITECTURE);
257} 257}
258 258
259/* end of sid_extractor.c */ 259/* end of sid_extractor.c */
diff --git a/src/plugins/xm_extractor.c b/src/plugins/xm_extractor.c
index a1aea27..d0b62bd 100644
--- a/src/plugins/xm_extractor.c
+++ b/src/plugins/xm_extractor.c
@@ -70,7 +70,7 @@ EXTRACTOR_xm_extract_method (struct EXTRACTOR_ExtractContext *ec)
70 char xmversion[8]; 70 char xmversion[8];
71 size_t n; 71 size_t n;
72 72
73 if (sizeof (struct Header) > 73 if ((ssize_t) sizeof (struct Header) >
74 ec->read (ec->cls, 74 ec->read (ec->cls,
75 &data, 75 &data,
76 sizeof (struct Header))) 76 sizeof (struct Header)))
@@ -81,9 +81,9 @@ EXTRACTOR_xm_extract_method (struct EXTRACTOR_ExtractContext *ec)
81 return; 81 return;
82 ADD("audio/x-xm", EXTRACTOR_METATYPE_MIMETYPE); 82 ADD("audio/x-xm", EXTRACTOR_METATYPE_MIMETYPE);
83 /* Version of Tracker */ 83 /* Version of Tracker */
84 snprintf (xmversion, 84 snprintf (xmversion,
85 sizeof (xmversion), 85 sizeof (xmversion),
86 "%d.%d", 86 "%d.%d",
87 head->version[1], 87 head->version[1],
88 head->version[0]); 88 head->version[0]);
89 ADD (xmversion, EXTRACTOR_METATYPE_FORMAT_VERSION); 89 ADD (xmversion, EXTRACTOR_METATYPE_FORMAT_VERSION);
@@ -99,7 +99,7 @@ EXTRACTOR_xm_extract_method (struct EXTRACTOR_ExtractContext *ec)
99 n = 19; 99 n = 19;
100 while ( (n > 0) && isspace ((unsigned char) tracker[n])) 100 while ( (n > 0) && isspace ((unsigned char) tracker[n]))
101 n--; 101 n--;
102 tracker[n + 1] = '\0'; 102 tracker[n + 1] = '\0';
103 ADD (tracker, EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE); 103 ADD (tracker, EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE);
104 return; 104 return;
105} 105}