swscale: don't use planar output functions to write to NV12/21.
authorRonald S. Bultje <rsbultje@gmail.com>
Sun, 26 Jun 2011 22:52:00 +0000 (15:52 -0700)
committerRonald Bultje <rbultje@dhcp-172-22-79-135.mtv.corp.google.com>
Tue, 28 Jun 2011 00:15:41 +0000 (17:15 -0700)
This prevents a crash when converting to NV12/21 without the bitexact
flags enabled.

libswscale/x86/swscale_template.c

index 79bf2a4..f6e9708 100644 (file)
@@ -2202,7 +2202,8 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
     enum PixelFormat srcFormat = c->srcFormat,
                      dstFormat = c->dstFormat;
 
     enum PixelFormat srcFormat = c->srcFormat,
                      dstFormat = c->dstFormat;
 
-    if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat)) {
+    if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
+        dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21) {
         if (!(c->flags & SWS_BITEXACT)) {
             if (c->flags & SWS_ACCURATE_RND) {
                 c->yuv2yuv1 = RENAME(yuv2yuv1_ar    );
         if (!(c->flags & SWS_BITEXACT)) {
             if (c->flags & SWS_ACCURATE_RND) {
                 c->yuv2yuv1 = RENAME(yuv2yuv1_ar    );