Skip to content

Commit edbab02

Browse files
committed
Fix gcc compilation + minor fix to LoadImage
1 parent 1b226a4 commit edbab02

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ags_spritevideo/ImageHelper.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ static bool LoadImageData(const char *filename, std::vector<uint8_t> &data)
2424
long off = ftell(f);
2525
fseek(f, 0, SEEK_SET);
2626
data.resize(off);
27-
fread(&data[0], 1, off, f);
27+
size_t read_num = fread(&data[0], 1, off, f);
28+
data.resize(read_num);
2829
fclose(f);
2930
return true;
3031
}
@@ -36,7 +37,8 @@ static bool LoadImageData(const char *filename, std::vector<uint8_t> &data)
3637
if (is)
3738
{
3839
data.resize(is->GetLength());
39-
is->Read(&data[0], data.size());
40+
size_t read_num = is->Read(&data[0], data.size());
41+
data.resize(read_num);
4042
is->Close();
4143
return true;
4244
}

ags_spritevideo/ImageHelper.h

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef SPRITEVIDEO_IMAGEHELPER_H
22
#define SPRITEVIDEO_IMAGEHELPER_H
33

4+
#include <stdint.h>
45
#include <vector>
56

67
struct ImageInfo

0 commit comments

Comments
 (0)