summaryrefslogtreecommitdiff
path: root/libavcodec/xwdenc.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-02-24 04:53:26 +0000
committerAnton Khirnov <anton@khirnov.net>2012-02-25 07:45:06 +0100
commit99cff417f381bd489f65d38b300bc0d2f3e78de5 (patch)
treef8aa8bc72e3af09c48f6b65fcbb69a3424d8aa69 /libavcodec/xwdenc.c
parent159a2436b03de541d533a5c331a0be66a8f3fbb5 (diff)
xwdenc: fix monow encoding
Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/xwdenc.c')
-rw-r--r--libavcodec/xwdenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c
index 67fac81619..8c98ef9f5d 100644
--- a/libavcodec/xwdenc.c
+++ b/libavcodec/xwdenc.c
@@ -44,7 +44,7 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
{
enum PixelFormat pix_fmt = avctx->pix_fmt;
uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
- uint32_t rgb[3] = { 0 };
+ uint32_t rgb[3] = { 0 }, bitorder = 0;
uint32_t header_size;
int i, out_size, ret;
uint8_t *ptr, *buf;
@@ -133,6 +133,8 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
ncolors = 256;
break;
case PIX_FMT_MONOWHITE:
+ be = 1;
+ bitorder = 1;
bpp = 1;
bpad = 8;
vclass = XWD_STATIC_GRAY;
@@ -164,7 +166,7 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_be32(&buf, 0); // bitmap x offset
bytestream_put_be32(&buf, be); // byte order
bytestream_put_be32(&buf, 32); // bitmap unit
- bytestream_put_be32(&buf, be); // bit-order of image data
+ bytestream_put_be32(&buf, bitorder); // bit-order of image data
bytestream_put_be32(&buf, bpad); // bitmap scan-line pad in bits
bytestream_put_be32(&buf, bpp); // bits per pixel
bytestream_put_be32(&buf, lsize); // bytes per scan-line