Skip to content

Commit dc73704

Browse files
committed
Fix another kernel buffer overrun.
Somehow 528cfbf didn't do this.
1 parent bfa901a commit dc73704

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

SerialPrograms/Source/Kernels/ImageFilters/Kernels_ImageFilter_Basic_Routines.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#include "Common/Cpp/Containers/FixedLimitVector.tpp"
1414
#include "Kernels_ImageFilter_Basic.h"
1515

16+
//#include <iostream>
17+
//using std::cout;
18+
//using std::endl;
19+
1620
namespace PokemonAutomation{
1721
namespace Kernels{
1822

@@ -112,13 +116,13 @@ PA_FORCE_INLINE void to_blackwhite_rbg32(
112116
const uint32_t* in = image;
113117
size_t shift = 0;
114118
size_t lc = width / VECTOR_SIZE;
115-
do{
119+
while (lc--){
116120
for (size_t c = 0; c < filter_count; c++){
117121
entries[c].process_full(filter[c].data + shift, in);
118122
}
119123
in += VECTOR_SIZE;
120124
shift += VECTOR_SIZE;
121-
}while (--lc);
125+
}
122126
size_t left = width % VECTOR_SIZE;
123127
if (left != 0){
124128
for (size_t c = 0; c < filter_count; c++){

0 commit comments

Comments
 (0)