diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2017-04-05 15:36:21 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2019-04-25 17:58:34 +0900 |
commit | 311e2d3a26ac4d11aa3de6e84fa6dc55a20bd4da (patch) | |
tree | f5e9ea0387d8546a818de436046c4a620250fe99 | |
parent | bb0296a6f1d3e8e605b594fb57e73e3cbd116f34 (diff) | |
download | libdrm-311e2d3a26ac4d11aa3de6e84fa6dc55a20bd4da.tar.gz libdrm-311e2d3a26ac4d11aa3de6e84fa6dc55a20bd4da.tar.bz2 libdrm-311e2d3a26ac4d11aa3de6e84fa6dc55a20bd4da.zip |
ipptest: fix possible division by zero
From fill_smpte_rgb32() function, there is possible path for
division by zero. So this patch removes it.
Change-Id: I3762b129b260e466495468a1faba994b7c8f4425
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r-- | tests/ipptest/util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/ipptest/util.c b/tests/ipptest/util.c index a1912201..dd0d1307 100644 --- a/tests/ipptest/util.c +++ b/tests/ipptest/util.c @@ -350,6 +350,9 @@ void fill_smpte_rgb32(unsigned char *mem, unsigned int width, unsigned int x; unsigned int y; + if (width < 7) + return; + for (y = 0; y < height * 6 / 9; ++y) { for (x = 0; x < width; ++x) ((uint32_t *)mem)[x] = colors_top[x * 7 / width]; |