1 Star 0 Fork 33

compile_success/libtiff_1

forked from src-openEuler/libtiff 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-raw2tiff-floating-point-exception.patch 834 Bytes
一键复制 编辑 原始数据 按行查看 历史
albatross 提交于 2022-04-02 15:29 +08:00 . modify libtiff.spec
From 42f499986d3c8a1dce55db7d97d501f8e9dfc8f6 Mon Sep 17 00:00:00 2001
From: t.feng <fengtao40@huawei.com>
Date: Mon, 13 Dec 2021 21:03:13 +0800
Subject: [PATCH] fix raw2tiff floating point exception
if we input illegal nbands, like:
raw2tiff -b :2 test.raw test.tif
we got:
Floating point exception (core dumped)
so, check nbands before guessSize
---
tools/raw2tiff.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/raw2tiff.c b/tools/raw2tiff.c
index dfee715..3a6f00e 100644
--- a/tools/raw2tiff.c
+++ b/tools/raw2tiff.c
@@ -209,6 +209,11 @@ main(int argc, char* argv[])
return (EXIT_FAILURE);
}
+ if (nbands == 0) {
+ fprintf(stderr, "The number of bands is illegal.\n");
+ return (-1);
+ }
+
if (guessSize(fd, dtype, hdr_size, nbands, swab, &width, &length) < 0)
return EXIT_FAILURE;
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/compile_success/libtiff_1.git
git@gitee.com:compile_success/libtiff_1.git
compile_success
libtiff_1
libtiff_1
master

搜索帮助