summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-24 00:35:11 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-24 01:00:24 +0100
commitfb8e5044b420d4f7409a3bf2cc5498e8302882be (patch)
treed77944814f7241eae2c467f113d483614be93084 /libswscale
parent1895d414aaacece3b57d7bf19502305e9a064fae (diff)
downloadffmpeg-streaming-fb8e5044b420d4f7409a3bf2cc5498e8302882be.zip
ffmpeg-streaming-fb8e5044b420d4f7409a3bf2cc5498e8302882be.tar.gz
swscale/utils: add asserts to check filterpos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index b63ab19..cfa6b21 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -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
OpenPOWER on IntegriCloud