swscale/utils: dont print message about filter size when the cause is a malloc failure
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 8 Apr 2014 22:23:56 +0000 (00:23 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 8 Apr 2014 22:57:12 +0000 (00:57 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/utils.c

index 983824b..20c2d4e 100644 (file)
@@ -577,8 +577,10 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
     filterSize = (minFilterSize + (filterAlign - 1)) & (~(filterAlign - 1));
     av_assert0(filterSize > 0);
     filter = av_malloc(filterSize * dstW * sizeof(*filter));
+    if (!filter)
+        goto fail;
     if (filterSize >= MAX_FILTER_SIZE * 16 /
-                      ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16) || !filter) {
+                      ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16)) {
         av_log(NULL, AV_LOG_ERROR, "sws: filterSize %d is too large, try less extreme scaling or increase MAX_FILTER_SIZE and recompile\n", filterSize);
         goto fail;
     }