diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/src/gd_io_dp.c')
-rw-r--r-- | Build/source/libs/gd/libgd-src/src/gd_io_dp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Build/source/libs/gd/libgd-src/src/gd_io_dp.c b/Build/source/libs/gd/libgd-src/src/gd_io_dp.c index eda2eeb0551..25c0980a9b3 100644 --- a/Build/source/libs/gd/libgd-src/src/gd_io_dp.c +++ b/Build/source/libs/gd/libgd-src/src/gd_io_dp.c @@ -180,6 +180,9 @@ static int dynamicSeek(struct gdIOCtx *ctx, const int pos) dynamicPtr *dp; dpIOCtx *dctx; + if (pos < 0) { + return FALSE; + } dctx = (dpIOCtx *)ctx; dp = dctx->dp; @@ -292,6 +295,10 @@ static int dynamicGetbuf(gdIOCtxPtr ctx, void *buf, int len) rlen = dp->realSize - dp->pos; } + if (rlen < 0) { + return 0; + } + memcpy(buf, (void *) ((char *)dp->data + dp->pos), rlen); dp->pos += rlen; |