Skip to content

Commit b2d03da

Browse files
committed
Fix realloc failure
1 parent 4473be5 commit b2d03da

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ option(GPL3 "Enable GPLv3 components" ON)
1212
option(BUILD_TESTING "Enable tests" OFF)
1313
option(BUILD_DOCS "Enable Doxygen documentation" OFF)
1414
option(CLANG_FORMAT "Enable Clang Format" ON)
15-
option(BUILD_TESTS_WITH_QT6 "Build test against Qt 6" OFF)
15+
option(BUILD_TESTS_WITH_QT6 "Build test against Qt 6" ON)
1616

1717
option(MOD_AVFORMAT "Enable avformat module" ON)
1818
option(MOD_DECKLINK "Enable DeckLink module" ON)

src/framework/mlt_animation.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,14 @@ char *mlt_animation_serialize_cut_tf(mlt_animation self,
742742
while (used + item_len + 2 > size) // +2 for ';' and NULL
743743
{
744744
size += 1000;
745-
ret = realloc(ret, size);
745+
char *tmp = realloc(ret, size);
746+
if (!tmp) {
747+
free(ret);
748+
mlt_property_close(item.property);
749+
mlt_property_close(time_property);
750+
return NULL;
751+
}
752+
ret = tmp;
746753
}
747754

748755
// Append item delimiter (;) if needed.

0 commit comments

Comments
 (0)