summaryrefslogtreecommitdiff
path: root/src/gd_bmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gd_bmp.c')
-rw-r--r--src/gd_bmp.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gd_bmp.c b/src/gd_bmp.c
index 1eb2ebe..7b29c1a 100644
--- a/src/gd_bmp.c
+++ b/src/gd_bmp.c
@@ -761,7 +761,9 @@ static int bmp_read_direct(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, b
/* There is a chance the data isn't until later, would be wierd but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
- gdSeek(infile, header->off);
+ if (!gdSeek(infile, header->off)) {
+ return 1;
+ }
}
/* The line must be divisible by 4, else its padded with NULLs */
@@ -856,7 +858,9 @@ static int bmp_read_1bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp
/* There is a chance the data isn't until later, would be wierd but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
- gdSeek(infile, header->off);
+ if (!gdSeek(infile, header->off)) {
+ return 1;
+ }
}
/* The line must be divisible by 4, else its padded with NULLs */
@@ -924,7 +928,9 @@ static int bmp_read_4bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp
/* There is a chance the data isn't until later, would be wierd but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
- gdSeek(infile, header->off);
+ if (!gdSeek(infile, header->off)) {
+ return 1;
+ }
}
/* The line must be divisible by 4, else its padded with NULLs */
@@ -1009,7 +1015,9 @@ static int bmp_read_8bit(gdImagePtr im, gdIOCtxPtr infile, bmp_info_t *info, bmp
/* There is a chance the data isn't until later, would be wierd but it is possible */
if (gdTell(infile) != header->off) {
/* Should make sure we don't seek past the file size */
- gdSeek(infile, header->off);
+ if (!gdSeek(infile, header->off)) {
+ return 1;
+ }
}
/* The line must be divisible by 4, else its padded with NULLs */