mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 08:47:28 +01:00
Fix puffs_base__writer1__copy_from_history32.
This commit is contained in:
1 parent
c69e256b0c
commit
82e5734778
4 files changed
+11
-14
No files matched your search
+2
-3
@@ -522,12 +522,11 @@ static inline uint32_t puffs_base__writer1__copy_from_history32(
|
||||
uint8_t* end,
|
||||
uint32_t distance,
|
||||
uint32_t length) {
|
||||
if (!start) {
|
||||
if (!start || !distance) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t* ptr = *ptr_ptr;
|
||||
size_t d = ptr - start;
|
||||
if ((d == 0) || (d < (size_t)(distance))) {
|
||||
if ((size_t)(ptr - start) < (size_t)(distance)) {
|
||||
return 0;
|
||||
}
|
||||
start = ptr - distance;
|
||||
|
||||
+2
-3
@@ -464,12 +464,11 @@ static inline uint32_t puffs_base__writer1__copy_from_history32(
|
||||
uint8_t* end,
|
||||
uint32_t distance,
|
||||
uint32_t length) {
|
||||
if (!start) {
|
||||
if (!start || !distance) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t* ptr = *ptr_ptr;
|
||||
size_t d = ptr - start;
|
||||
if ((d == 0) || (d < (size_t)(distance))) {
|
||||
if ((size_t)(ptr - start) < (size_t)(distance)) {
|
||||
return 0;
|
||||
}
|
||||
start = ptr - distance;
|
||||
|
||||
Reference in new issue
Block a user