Commit fb8e5044 authored by Michael Niedermayer's avatar Michael Niedermayer

swscale/utils: add asserts to check filterpos

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1895d414
......@@ -631,6 +631,13 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
(*filterPos)[i]-= shift;
filter[i * filterSize + srcW - 1 - (*filterPos)[i]] += acc;
}
av_assert0((*filterPos)[i] >= 0);
av_assert0((*filterPos)[i] < srcW);
if ((*filterPos)[i] + filterSize > srcW) {
for (j = 0; j < filterSize; j++) {
av_assert0((*filterPos)[i] + j < srcW || !filter[i * filterSize + j]);
}
}
}
// Note the +1 is for the MMX scaler which reads over the end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment