summaryrefslogtreecommitdiff
path: root/libavcodec/dds.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-20 00:03:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-20 00:03:11 +0200
commit5c583b141980102530c75d2756b06766742532a1 (patch)
tree4a5432f67491f4cc7daed507f2b00d33e170730c /libavcodec/dds.c
parent36a87c2dc7f302da3778bd0cff050b5c93a730c7 (diff)
downloadffmpeg-5c583b141980102530c75d2756b06766742532a1.tar.gz
avcodec/dds: Flip more R<->B cases
Fixes Ticket4665 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dds.c')
-rw-r--r--libavcodec/dds.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/dds.c b/libavcodec/dds.c
index 566954ddd9..f41571e18b 100644
--- a/libavcodec/dds.c
+++ b/libavcodec/dds.c
@@ -357,13 +357,13 @@ static int parse_pixel_format(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_BGR24;
/* 32 bpp */
else if (bpp == 32 && r == 0xff0000 && g == 0xff00 && b == 0xff && a == 0)
- avctx->pix_fmt = AV_PIX_FMT_RGBA; // opaque
+ avctx->pix_fmt = AV_PIX_FMT_BGR0; // opaque
else if (bpp == 32 && r == 0xff && g == 0xff00 && b == 0xff0000 && a == 0)
- avctx->pix_fmt = AV_PIX_FMT_BGRA; // opaque
+ avctx->pix_fmt = AV_PIX_FMT_RGB0; // opaque
else if (bpp == 32 && r == 0xff0000 && g == 0xff00 && b == 0xff && a == 0xff000000)
- avctx->pix_fmt = AV_PIX_FMT_RGBA;
- else if (bpp == 32 && r == 0xff && g == 0xff00 && b == 0xff0000 && a == 0xff000000)
avctx->pix_fmt = AV_PIX_FMT_BGRA;
+ else if (bpp == 32 && r == 0xff && g == 0xff00 && b == 0xff0000 && a == 0xff000000)
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
/* give up */
else {
av_log(avctx, AV_LOG_ERROR, "Unknown pixel format "
@@ -646,7 +646,11 @@ static int dds_decode(AVCodecContext *avctx, void *data,
}
/* Run any post processing here if needed. */
- if (avctx->pix_fmt == AV_PIX_FMT_RGBA || avctx->pix_fmt == AV_PIX_FMT_YA8)
+ if (avctx->pix_fmt == AV_PIX_FMT_BGRA ||
+ avctx->pix_fmt == AV_PIX_FMT_RGBA ||
+ avctx->pix_fmt == AV_PIX_FMT_RGB0 ||
+ avctx->pix_fmt == AV_PIX_FMT_BGR0 ||
+ avctx->pix_fmt == AV_PIX_FMT_YA8)
run_postproc(avctx, frame);
/* Frame is ready to be output. */