Skip to content

Commit

Permalink
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ Features:
* Support Apple M3X temperature detection (CPU / GPU, macOS)
* `--ds-force-drm` support a new option `sysfs-only`

Bugfixes:
* Fix crashes sometimes when `--logo-padding-top` is not set (Logo)

# 2.3.4

Bugfixes:
8 changes: 5 additions & 3 deletions src/util/FFstrbuf.c
Original file line number Diff line number Diff line change
@@ -59,9 +59,9 @@ void ffStrbufEnsureFixedLengthFree(FFstrbuf* strbuf, uint32_t free)
uint32_t oldFree = ffStrbufGetFree(strbuf);
if (oldFree >= free && !(strbuf->allocated == 0 && strbuf->length > 0))
return;

uint32_t newCap = strbuf->allocated + (free - oldFree);

if(strbuf->allocated == 0)
{
newCap += strbuf->length + 1; // +1 for the NUL
@@ -74,7 +74,7 @@ void ffStrbufEnsureFixedLengthFree(FFstrbuf* strbuf, uint32_t free)
}
else
strbuf->chars = realloc(strbuf->chars, sizeof(*strbuf->chars) * newCap);

strbuf->allocated = newCap;
}

@@ -99,6 +99,8 @@ void ffStrbufAppendC(FFstrbuf* strbuf, char c)

void ffStrbufAppendNC(FFstrbuf* strbuf, uint32_t num, char c)
{
if (num == 0) return;

ffStrbufEnsureFree(strbuf, num);
memset(&strbuf->chars[strbuf->length], c, num);
strbuf->length += num;

0 comments on commit 165c213

Please sign in to comment.