|
Lines 13-19
Link Here
|
| 13 |
#include <jpeglib.h> |
13 |
#include <jpeglib.h> |
| 14 |
|
14 |
|
| 15 |
#include "rcfile.h" |
15 |
#include "rcfile.h" |
| 16 |
|
16 |
#include "sizetmax.h" |
| 17 |
#include "readjpeg.h" |
17 |
#include "readjpeg.h" |
| 18 |
|
18 |
|
| 19 |
|
19 |
|
|
Lines 265-276
Link Here
|
| 265 |
/* this one shouldn't hurt */ |
265 |
/* this one shouldn't hurt */ |
| 266 |
cinfo.do_block_smoothing=FALSE; |
266 |
cinfo.do_block_smoothing=FALSE; |
| 267 |
|
267 |
|
|
|
268 |
if ((width <= 0) || (height <=0 ) || |
| 269 |
(width > (SIZE_T_MAX/height)) || |
| 270 |
((width * height) > SIZE_T_MAX/3)) |
| 271 |
longjmp(jerr.setjmp_buffer,1); |
| 272 |
|
| 268 |
if((*imagep=image=malloc(width*height*3))==NULL) |
273 |
if((*imagep=image=malloc(width*height*3))==NULL) |
| 269 |
longjmp(jerr.setjmp_buffer,1); |
274 |
longjmp(jerr.setjmp_buffer,1); |
| 270 |
|
275 |
|
| 271 |
jpeg_start_decompress(&cinfo); |
276 |
jpeg_start_decompress(&cinfo); |
| 272 |
|
277 |
|
| 273 |
/* read the image */ |
278 |
/* read the image */ |
|
|
279 |
if ((height <= 0) || |
| 280 |
(height > (SIZE_T_MAX/sizeof(unsigned char *)))) |
| 281 |
longjmp(jerr.setjmp_buffer,1); |
| 282 |
|
| 274 |
if((lineptrs=malloc(height*sizeof(unsigned char *)))==NULL) |
283 |
if((lineptrs=malloc(height*sizeof(unsigned char *)))==NULL) |
| 275 |
longjmp(jerr.setjmp_buffer,1); |
284 |
longjmp(jerr.setjmp_buffer,1); |
| 276 |
|
285 |
|