Skip to content

Commit

Permalink
fix issue #41.
Browse files Browse the repository at this point in the history
  • Loading branch information
rockcarry committed Jun 2, 2021
1 parent f3f0447 commit 15e982c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/jfif.c
Expand Up @@ -443,6 +443,12 @@ int jfif_decode(void *ctxt, BMP *pb)
yuv_datbuf[1] = malloc(sizeof(int) * yuv_stride[1] * yuv_height[1]);
yuv_datbuf[2] = malloc(sizeof(int) * yuv_stride[2] * yuv_height[2]);
yuv_datbuf[3] = malloc(sizeof(int) * yuv_stride[3] * yuv_height[3]);
if ( (long long)yuv_stride[0] * yuv_height[0] >= 0x20000000 || (long long)yuv_stride[1] * yuv_height[1] >= 0x20000000
|| (long long)yuv_stride[2] * yuv_height[2] >= 0x20000000 || (long long)yuv_stride[3] * yuv_height[3] >= 0x20000000)
{
printf("image's width * height is out of range !\n");
goto done;
}
if (!yuv_datbuf[0] || !yuv_datbuf[1] || !yuv_datbuf[2] || !yuv_datbuf[3]) {
goto done;
}
Expand Down

0 comments on commit 15e982c

Please sign in to comment.