summaryrefslogtreecommitdiff
path: root/libavcodec/png.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2006-10-14 12:23:54 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2006-10-14 12:23:54 +0000
commitab9ce191707b23694b98d730fd28e8ddb940ec2b (patch)
treec03e170b4ad883bc5ab624d64dfdfbfd0c9b7025 /libavcodec/png.c
parent4ec0beaa593860796feead14132506226a1edf0e (diff)
Make PNG produce correct 8-bit pictures
Originally committed as revision 6689 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/png.c')
-rw-r--r--libavcodec/png.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/png.c b/libavcodec/png.c
index 0dd9eaec23..6d588c35a8 100644
--- a/libavcodec/png.c
+++ b/libavcodec/png.c
@@ -850,7 +850,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
for(i = 0; i < 256; i++) {
v = palette[i];
alpha = v >> 24;
- if (alpha != 0xff)
+ if (alpha && alpha != 0xff)
has_alpha = 1;
*alpha_ptr++ = alpha;
ptr[0] = v >> 16;