aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-01 00:27:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-01 00:27:28 +0200
commit2e2a2d8801b045b3dd58a4e49e8e040b559bc84a (patch)
treee223bfd909aea93e7c1f8168c6df123e26ccb1a8
parent01e3340fb6022465ab23cf4a67a89c869b64476e (diff)
downloadffmpeg-2e2a2d8801b045b3dd58a4e49e8e040b559bc84a.tar.gz
swscale/utils: dont divide by zero with zero vectors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswscale/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 05ab0c6f86..a2e3ce1723 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -622,6 +622,10 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
sum += filter[i * filterSize + j];
}
sum = (sum + one / 2) / one;
+ if (!sum) {
+ av_log(NULL, AV_LOG_WARNING, "SwScaler: zero vector in scaling\n");
+ sum = 1;
+ }
for (j = 0; j < *outFilterSize; j++) {
int64_t v = filter[i * filterSize + j] + error;
int intV = ROUNDED_DIV(v, sum);