Viewing 0 reply threads
  • Author
    Posts
    • #7683 Score: 0
      锟斤拷
      Participant
      3 pts

      rasterizer.cpp中的set_pixel函数(232行)判断超出边界的条件有误,由于这里采用左下角为起点,因此point.y()的取值范围应该是(0, height]而不是[0, height),比如当point.y()的值等于0时,height - point.y()的值为height,用此时求出的ind访问frame_buf会越界,判断条件我觉得应该是
      `cpp
      if (point.x() < 0 || point.x() >= width ||
      point.y() <= 0 || point.y() > height) return;
      `

Viewing 0 reply threads
  • You must be logged in to reply to this topic.