summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_bmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd_bmp.c')
-rw-r--r--ext/gd/libgd/gd_bmp.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/gd/libgd/gd_bmp.c b/ext/gd/libgd/gd_bmp.c
index 93a9d61601..8af8751299 100644
--- a/ext/gd/libgd/gd_bmp.c
+++ b/ext/gd/libgd/gd_bmp.c
@@ -711,7 +711,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 */
@@ -806,7 +808,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 */
@@ -874,7 +878,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 */
@@ -959,7 +965,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 */