mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-02 09:40:15 +00:00
pad_for_image: don't allow a short count
This commit is contained in:
parent
b0b5e49383
commit
6288f5765f
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user