mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
tiffdec,ReadTIFF: ensure data_size is < tsize_t max
Change-Id: I0ad9589a7f994294100e1c5a38abf6ebe417f8a9
This commit is contained in:
parent
d988eb7b39
commit
dd7e83cca7
@ -15,6 +15,7 @@
|
|||||||
#include "webp/config.h"
|
#include "webp/config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -162,7 +163,9 @@ int ReadTIFF(const uint8_t* const data, size_t data_size,
|
|||||||
int ok = 0;
|
int ok = 0;
|
||||||
tdir_t dircount;
|
tdir_t dircount;
|
||||||
|
|
||||||
if (data == NULL || data_size == 0 || pic == NULL) return 0;
|
if (data == NULL || data_size == 0 || data_size > INT_MAX || pic == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
tif = TIFFClientOpen("Memory", "r", &my_data,
|
tif = TIFFClientOpen("Memory", "r", &my_data,
|
||||||
MyRead, MyRead, MySeek, MyClose,
|
MyRead, MyRead, MySeek, MyClose,
|
||||||
|
Loading…
Reference in New Issue
Block a user