@@ -130,7 +130,7 @@ const char wma_magic[] = { (char)0x30, (char)0x26, (char)0xB2, (char)0x75 };
130
130
131
131
std::unique_ptr<AudioDecoder> AudioDecoder::Create (FILE* file, const std::string& filename) {
132
132
char magic[4 ] = { 0 };
133
- if (fread (magic, 4 , 1 , file) != 4 )
133
+ if (fread (magic, 4 , 1 , file) != 1 )
134
134
return nullptr ;
135
135
fseek (file, 0 , SEEK_SET);
136
136
@@ -176,7 +176,7 @@ std::unique_ptr<AudioDecoder> AudioDecoder::Create(FILE* file, const std::string
176
176
if (!strncmp (magic, " OggS" , 4 )) { // OGG
177
177
#ifdef HAVE_OPUS
178
178
fseek (file, 28 , SEEK_SET);
179
- if (fread (magic, 4 , 1 , file) != 4 )
179
+ if (fread (magic, 4 , 1 , file) != 1 )
180
180
return nullptr ;
181
181
fseek (file, 0 , SEEK_SET);
182
182
if (!strncmp (magic, " Opus" , 4 )) {
@@ -190,7 +190,7 @@ std::unique_ptr<AudioDecoder> AudioDecoder::Create(FILE* file, const std::string
190
190
191
191
#if defined(HAVE_TREMOR) || defined(HAVE_OGGVORBIS)
192
192
fseek (file, 29 , SEEK_SET);
193
- if (fread (magic, 4 , 1 , file) != 4 )
193
+ if (fread (magic, 4 , 1 , file) != 1 )
194
194
return nullptr ;
195
195
fseek (file, 0 , SEEK_SET);
196
196
@@ -209,7 +209,7 @@ std::unique_ptr<AudioDecoder> AudioDecoder::Create(FILE* file, const std::string
209
209
if (!strncmp (magic, " RIFF" , 4 )) {
210
210
fseek (file, 20 , SEEK_SET);
211
211
uint16_t raw_enc;
212
- if (fread (&raw_enc, 2 , 1 , file) != 2 )
212
+ if (fread (&raw_enc, 2 , 1 , file) != 1 )
213
213
return nullptr ;
214
214
Utils::SwapByteOrder (raw_enc);
215
215
fseek (file, 0 , SEEK_SET);
0 commit comments