mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
add some param check condition
This commit is contained in:
@@ -323,6 +323,15 @@ static int rga_check_param(const struct rga_req *req)
|
||||
}
|
||||
}
|
||||
|
||||
if(!((req->render_mode == color_fill_mode) || (req->render_mode == line_point_drawing_mode)))
|
||||
{
|
||||
if (unlikely((req->src.vir_w <= 0) || (req->src.vir_w > 8191) || (req->src.vir_h <= 0) || (req->src.vir_h > 8191)))
|
||||
{
|
||||
ERR("invalid source resolution vir_w = %d, vir_h = %d\n", req->src.vir_w, req->src.vir_h);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
//check dst width and height
|
||||
if (unlikely((req->dst.act_w <= 0) || (req->dst.act_w > 2048) || (req->dst.act_h <= 0) || (req->dst.act_h > 2048)))
|
||||
{
|
||||
@@ -330,6 +339,12 @@ static int rga_check_param(const struct rga_req *req)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (unlikely((req->dst.vir_w <= 0) || (req->dst.vir_w > 2048) || (req->dst.vir_h <= 0) || (req->dst.vir_h > 2048)))
|
||||
{
|
||||
ERR("invalid destination resolution vir_w = %d, vir_h = %d\n", req->dst.vir_w, req->dst.vir_h);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
//check src_vir_w
|
||||
if(unlikely(req->src.vir_w < req->src.act_w)){
|
||||
ERR("invalid src_vir_w act_w = %d, vir_w = %d\n", req->src.act_w, req->src.vir_w);
|
||||
|
||||
Reference in New Issue
Block a user