pad_for_image: don't allow a short count

This commit is contained in:
nick black 2021-07-27 14:17:34 -04:00 committed by nick black
parent b0b5e49383
commit 6288f5765f

View File

@ -566,6 +566,9 @@ static inline size_t
pad_for_image(size_t stride, int cols){ pad_for_image(size_t stride, int cols){
if(visual_implementation.rowalign == 0){ if(visual_implementation.rowalign == 0){
return 4 * cols; return 4 * cols;
}else if(stride < cols * 4u){
return (4 * cols + visual_implementation.rowalign) /
visual_implementation.rowalign * visual_implementation.rowalign;
}else if(stride % visual_implementation.rowalign == 0){ }else if(stride % visual_implementation.rowalign == 0){
return stride; return stride;
} }