提交 38f026c8 编写于 作者: P prr

8210866: Improve JPEG processing

Reviewed-by: serb, psadhukhan, rhalade
上级 0a8e94d2
......@@ -406,6 +406,9 @@ alloc_sarray (j_common_ptr cinfo, int pool_id,
JDIMENSION rowsperchunk, currow, i;
long ltemp;
if (samplesperrow == 0) {
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
}
/* Calculate max # of rows allowed in one allocation chunk */
ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
((long) samplesperrow * SIZEOF(JSAMPLE));
......@@ -454,6 +457,10 @@ alloc_barray (j_common_ptr cinfo, int pool_id,
JDIMENSION rowsperchunk, currow, i;
long ltemp;
if (blocksperrow == 0) {
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
}
/* Calculate max # of rows allowed in one allocation chunk */
ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /
((long) blocksperrow * SIZEOF(JBLOCK));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册