mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Change gif workbuf_len worst case from 1 to 0
This commit is contained in:
1 parent
555e8eaaa3
commit
3fd6aca365
6 files changed
+13
-23
No files matched your search
@@ -236,10 +236,15 @@ const char* try_allocate(wuffs_gif__decoder* dec) {
|
||||
return "could not allocate prev-dst buffer";
|
||||
}
|
||||
|
||||
workbuf = wuffs_base__malloc_slice_u8(
|
||||
malloc, wuffs_gif__decoder__workbuf_len(dec).max_incl);
|
||||
if (!workbuf.ptr) {
|
||||
return "could not allocate work buffer";
|
||||
uint64_t workbuf_len_max_incl = wuffs_gif__decoder__workbuf_len(dec).max_incl;
|
||||
if (workbuf_len_max_incl > 0) {
|
||||
workbuf = wuffs_base__malloc_slice_u8(
|
||||
malloc, wuffs_gif__decoder__workbuf_len(dec).max_incl);
|
||||
if (!workbuf.ptr) {
|
||||
return "could not allocate work buffer";
|
||||
}
|
||||
} else {
|
||||
workbuf = wuffs_base__make_slice_u8(NULL, 0);
|
||||
}
|
||||
|
||||
uint64_t plen = 1 + ((uint64_t)(width) + 1) * (uint64_t)(height);
|
||||
|
||||
Reference in new issue
Block a user