Browse Source

swscale/utils: add asserts to check filterpos

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.6
Michael Niedermayer 11 years ago
parent
commit
fb8e5044b4
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libswscale/utils.c

+ 7
- 0
libswscale/utils.c View File

@@ -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


Loading…
Cancel
Save