Commit 745f4bcc authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vsrc_testsrc: draw_bar: make sure width is not negative

Reported-by: Josh de Kock
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent ab87df9a
......@@ -1309,8 +1309,8 @@ static void draw_bar(TestSourceContext *test, const uint8_t color[4],
x = FFMIN(x, test->w - 1);
y = FFMIN(y, test->h - 1);
w = FFMIN(w, test->w - x);
h = FFMIN(h, test->h - y);
w = FFMAX(FFMIN(w, test->w - x), 0);
h = FFMAX(FFMIN(h, test->h - y), 0);
av_assert0(x + w <= test->w);
av_assert0(y + h <= test->h);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment