Skip to content

Commit

Permalink
Ensure qtblend doesn't request an image of 0 width or height (crashes…
Browse files Browse the repository at this point in the history
… many filters)
  • Loading branch information
j-b-m committed Oct 5, 2023
1 parent 482f1fb commit 09f55bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/qt/filter_qtblend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ static int filter_get_image(mlt_frame frame,
|| rect.h != *height;

if (mlt_properties_get_int(properties, "distort") == 0) {
b_height = qMin((int) rect.h, b_height);
b_width = b_height * b_dar / b_ar / consumer_ar;
b_height = qMax(1, qMin((int) rect.h, b_height));
b_width = qMax(1, int(b_height * b_dar / b_ar / consumer_ar));
} else {
b_width *= b_ar / consumer_ar;
b_width = qMax(1, int(b_width * b_ar / consumer_ar));
}
if (!hasAlpha && (b_width < *width || b_height < *height)) {
hasAlpha = true;
Expand Down
3 changes: 3 additions & 0 deletions src/modules/qt/transition_qtblend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ static int get_image(mlt_frame a_frame,
// we will process operations on top frame, so also process b_frame
forceAlpha = true;
}
// Ensure we don't request an image with a 0 width or height
b_width = qMax(1, b_width);
b_height = qMax(1, b_height);
} else {
b_height = *height;
b_width = *width;
Expand Down

0 comments on commit 09f55bf

Please sign in to comment.