[FFmpeg-cvslog] swscale: don't use planar output functions to write to NV12/21.

Ronald S. Bultje git at videolan.org
Thu Sep 22 01:17:20 CEST 2011


ffmpeg | branch: release/0.8 | Ronald S. Bultje <rsbultje at gmail.com> | Sun Jun 26 15:52:00 2011 -0700| [acf2d3293c305c96ac0afda28bd55233af4ce61c] | committer: Anton Khirnov

swscale: don't use planar output functions to write to NV12/21.

This prevents a crash when converting to NV12/21 without the bitexact
flags enabled.
(cherry picked from commit 0d994b2f45c08794899057ee7ca54f48218c0a53)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=acf2d3293c305c96ac0afda28bd55233af4ce61c
---

 libswscale/x86/swscale_template.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index 8fad257..dc92cdd 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -2203,7 +2203,8 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
     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    );



More information about the ffmpeg-cvslog mailing list