bug fix for seg fault when the FULL_WIDTH and FULL_HEIGHT are larger than input