swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 4 Jan 2016 22:22:25 +0000 (23:22 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 4 Jan 2016 22:54:11 +0000 (23:54 +0100)
Fixes Ticket4960

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libswscale/utils.c

index e5593af..1875a54 100644 (file)
@@ -1202,6 +1202,12 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
                srcW, srcH, dstW, dstH);
         return AVERROR(EINVAL);
     }
+    if (flags & SWS_FAST_BILINEAR) {
+        if (srcW < 8 || dstW < 8) {
+            flags ^= SWS_FAST_BILINEAR | SWS_BILINEAR;
+            c->flags = flags;
+        }
+    }
 
     if (!dstFilter)
         dstFilter = &dummyFilter;