diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/unzip.c | 30 | ||||
-rw-r--r-- | src/main/extractor.c | 2 | ||||
-rw-r--r-- | src/plugins/flv_extractor.c | 16 | ||||
-rw-r--r-- | src/plugins/jpeg_extractor.c | 2 |
4 files changed, 23 insertions, 27 deletions
diff --git a/src/common/unzip.c b/src/common/unzip.c index 553ae6a..0795658 100644 --- a/src/common/unzip.c +++ b/src/common/unzip.c | |||
@@ -18,6 +18,12 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* This code is based in part on | ||
22 | unzip 1.00 Copyright 1998-2003 Gilles Vollant | ||
23 | http://www.winimage.com/zLibDll" | ||
24 | */ | ||
25 | |||
26 | |||
21 | #include "platform.h" | 27 | #include "platform.h" |
22 | #include <ctype.h> | 28 | #include <ctype.h> |
23 | #include "extractor.h" | 29 | #include "extractor.h" |
@@ -94,8 +100,6 @@ typedef struct unz_global_info_s | |||
94 | #define SIZEZIPLOCALHEADER (0x1e) | 100 | #define SIZEZIPLOCALHEADER (0x1e) |
95 | 101 | ||
96 | 102 | ||
97 | const char unz_copyright[] = | ||
98 | " unzip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll"; | ||
99 | 103 | ||
100 | /* EXTRACTOR_unzip_file_info_interntal contain internal info about a file in zipfile*/ | 104 | /* EXTRACTOR_unzip_file_info_interntal contain internal info about a file in zipfile*/ |
101 | typedef struct unz_file_info_internal_s | 105 | typedef struct unz_file_info_internal_s |
@@ -583,8 +587,6 @@ EXTRACTOR_common_unzip_open2 (const char *path, | |||
583 | 587 | ||
584 | int err=EXTRACTOR_UNZIP_OK; | 588 | int err=EXTRACTOR_UNZIP_OK; |
585 | 589 | ||
586 | if (unz_copyright[0]!=' ') | ||
587 | return NULL; | ||
588 | memset (&us, 0, sizeof(us)); | 590 | memset (&us, 0, sizeof(us)); |
589 | us.z_filefunc = *pzlib_filefunc_def; | 591 | us.z_filefunc = *pzlib_filefunc_def; |
590 | 592 | ||
@@ -1007,7 +1009,7 @@ unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, | |||
1007 | uLong uMagic,uData,uFlags; | 1009 | uLong uMagic,uData,uFlags; |
1008 | uLong size_filename; | 1010 | uLong size_filename; |
1009 | uLong size_extra_field; | 1011 | uLong size_extra_field; |
1010 | int err=EXTRACTOR_UNZIP_OK; | 1012 | int err = EXTRACTOR_UNZIP_OK; |
1011 | 1013 | ||
1012 | *piSizeVar = 0; | 1014 | *piSizeVar = 0; |
1013 | *poffset_local_extrafield = 0; | 1015 | *poffset_local_extrafield = 0; |
@@ -1015,21 +1017,13 @@ unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, | |||
1015 | 1017 | ||
1016 | if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + | 1018 | if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + |
1017 | s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) | 1019 | s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) |
1018 | return EXTRACTOR_UNZIP_ERRNO; | 1020 | return EXTRACTOR_UNZIP_ERRNO; |
1019 | 1021 | if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != EXTRACTOR_UNZIP_OK) | |
1020 | 1022 | err=EXTRACTOR_UNZIP_ERRNO; | |
1021 | if (err==EXTRACTOR_UNZIP_OK) { | 1023 | else if (uMagic!=0x04034b50) |
1022 | if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != EXTRACTOR_UNZIP_OK) | 1024 | err=EXTRACTOR_UNZIP_BADZIPFILE; |
1023 | err=EXTRACTOR_UNZIP_ERRNO; | ||
1024 | else if (uMagic!=0x04034b50) | ||
1025 | err=EXTRACTOR_UNZIP_BADZIPFILE; | ||
1026 | } | ||
1027 | if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != EXTRACTOR_UNZIP_OK) | 1025 | if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != EXTRACTOR_UNZIP_OK) |
1028 | err=EXTRACTOR_UNZIP_ERRNO; | 1026 | err=EXTRACTOR_UNZIP_ERRNO; |
1029 | /* | ||
1030 | else if ((err==EXTRACTOR_UNZIP_OK) && (uData!=s->cur_file_info.wVersion)) | ||
1031 | err=EXTRACTOR_UNZIP_BADZIPFILE; | ||
1032 | */ | ||
1033 | if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != EXTRACTOR_UNZIP_OK) | 1027 | if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != EXTRACTOR_UNZIP_OK) |
1034 | err=EXTRACTOR_UNZIP_ERRNO; | 1028 | err=EXTRACTOR_UNZIP_ERRNO; |
1035 | 1029 | ||
diff --git a/src/main/extractor.c b/src/main/extractor.c index 0d9d7c2..a077a3d 100644 --- a/src/main/extractor.c +++ b/src/main/extractor.c | |||
@@ -1650,8 +1650,8 @@ make_shm (int is_tail, | |||
1650 | CloseHandle (*mappedFile); | 1650 | CloseHandle (*mappedFile); |
1651 | return 1; | 1651 | return 1; |
1652 | } | 1652 | } |
1653 | #endif | ||
1654 | return 0; | 1653 | return 0; |
1654 | #endif | ||
1655 | } | 1655 | } |
1656 | 1656 | ||
1657 | 1657 | ||
diff --git a/src/plugins/flv_extractor.c b/src/plugins/flv_extractor.c index f70571f..7572b6d 100644 --- a/src/plugins/flv_extractor.c +++ b/src/plugins/flv_extractor.c | |||
@@ -689,6 +689,8 @@ static void handleASEnd(unsigned char type, void * value, void * userdata) | |||
689 | { | 689 | { |
690 | double n = *((double *)value); | 690 | double n = *((double *)value); |
691 | switch (state->currentAttribute) { | 691 | switch (state->currentAttribute) { |
692 | case FLV_NONE: /* make gcc happy */ | ||
693 | break; | ||
692 | case FLV_STEREO: | 694 | case FLV_STEREO: |
693 | break; | 695 | break; |
694 | case FLV_ACHANNELS: | 696 | case FLV_ACHANNELS: |
@@ -1089,11 +1091,11 @@ static char * printAudioFormat(FLVStreamInfo *stinfo) | |||
1089 | size_t len = MAX_FLV_FORMAT_LINE; | 1091 | size_t len = MAX_FLV_FORMAT_LINE; |
1090 | 1092 | ||
1091 | n = 0; | 1093 | n = 0; |
1092 | if (stinfo->audioRate != -1 && n < len) { | 1094 | if ( (stinfo->audioRate != -1) && (n < len)) { |
1093 | n += snprintf(s+n, len-n, "%s Hz", FLVAudioSampleRates[stinfo->audioRate]); | 1095 | n += snprintf(s+n, len-n, "%s Hz", FLVAudioSampleRates[stinfo->audioRate]); |
1094 | } | 1096 | } |
1095 | 1097 | ||
1096 | if (stinfo->audioSampleBits != -1 && n < len) { | 1098 | if ((stinfo->audioSampleBits != -1) && (n < len)) { |
1097 | if (n > 0) | 1099 | if (n > 0) |
1098 | n += snprintf(s+n, len-n, ", "); | 1100 | n += snprintf(s+n, len-n, ", "); |
1099 | if (n < len) | 1101 | if (n < len) |
@@ -1101,7 +1103,7 @@ static char * printAudioFormat(FLVStreamInfo *stinfo) | |||
1101 | FLVAudioSampleSizes[stinfo->audioSampleBits]); | 1103 | FLVAudioSampleSizes[stinfo->audioSampleBits]); |
1102 | } | 1104 | } |
1103 | 1105 | ||
1104 | if (stinfo->audioChannels != -1 && n < len) { | 1106 | if ((stinfo->audioChannels != -1) && (n < len)) { |
1105 | if (n > 0) | 1107 | if (n > 0) |
1106 | n += snprintf(s+n, len-n, ", "); | 1108 | n += snprintf(s+n, len-n, ", "); |
1107 | if (n < len) { | 1109 | if (n < len) { |
@@ -1114,21 +1116,21 @@ static char * printAudioFormat(FLVStreamInfo *stinfo) | |||
1114 | } | 1116 | } |
1115 | } | 1117 | } |
1116 | 1118 | ||
1117 | if (stinfo->audioCodec > -1 && stinfo->audioCodec < 12 && | 1119 | if ((stinfo->audioCodec > -1) && (stinfo->audioCodec < 12) && |
1118 | FLVAudioCodecs[stinfo->audioCodec] != NULL && n < len) { | 1120 | (FLVAudioCodecs[stinfo->audioCodec] != NULL) && (n < len)) { |
1119 | if (n > 0) | 1121 | if (n > 0) |
1120 | n += snprintf(s+n, len-n, ", "); | 1122 | n += snprintf(s+n, len-n, ", "); |
1121 | if (n < len) | 1123 | if (n < len) |
1122 | n += snprintf(s+n, len-n, "%s", FLVAudioCodecs[stinfo->audioCodec]); | 1124 | n += snprintf(s+n, len-n, "%s", FLVAudioCodecs[stinfo->audioCodec]); |
1123 | } | 1125 | } |
1124 | else if (stinfo->audioCodecStr != NULL && n < len) { | 1126 | else if ((stinfo->audioCodecStr != NULL) && (n < len)) { |
1125 | if (n > 0) | 1127 | if (n > 0) |
1126 | n += snprintf(s+n, len-n, ", "); | 1128 | n += snprintf(s+n, len-n, ", "); |
1127 | if (n < len) | 1129 | if (n < len) |
1128 | n += snprintf(s+n, len-n, "%s", stinfo->audioCodecStr); | 1130 | n += snprintf(s+n, len-n, "%s", stinfo->audioCodecStr); |
1129 | } | 1131 | } |
1130 | 1132 | ||
1131 | if (stinfo->audioDataRate != 0.0 && n < len) { | 1133 | if ((stinfo->audioDataRate != 0.0) && (n < len)) { |
1132 | if (n > 0) | 1134 | if (n > 0) |
1133 | n += snprintf(s+n, len-n, ", "); | 1135 | n += snprintf(s+n, len-n, ", "); |
1134 | if (n < len) | 1136 | if (n < len) |
diff --git a/src/plugins/jpeg_extractor.c b/src/plugins/jpeg_extractor.c index cb5442f..a0722d4 100644 --- a/src/plugins/jpeg_extractor.c +++ b/src/plugins/jpeg_extractor.c | |||
@@ -81,7 +81,7 @@ next_marker (const unsigned char **data, const unsigned char *end) | |||
81 | { | 81 | { |
82 | c = NEXTC (data, end); | 82 | c = NEXTC (data, end); |
83 | } | 83 | } |
84 | while ((c == 0xFF) && (c != -1)); | 84 | while (c == 0xFF); |
85 | return c; | 85 | return c; |
86 | } | 86 | } |
87 | 87 | ||