summaryrefslogtreecommitdiff
path: root/libavcodec/gifdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-12-20 23:05:42 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-12-20 23:05:42 +0100
commitd4fdaafdb76a927be6fea15013807641bbcc6bd9 (patch)
tree031739101dea90510f4cb6a7602c341208f94c9e /libavcodec/gifdec.c
parent9321e93502810e4a3fcaf87bac156dba2fe3b477 (diff)
Always write all colours for animated gif files, including transparent ones.
This fixes the colour of the transparent background (as seen with ffplay), and makes the background of some non-keyframes transparent that was incorrectly shown as opaque for some samples.
Diffstat (limited to 'libavcodec/gifdec.c')
-rw-r--r--libavcodec/gifdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 9a3aef075f..077aef0200 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -241,8 +241,9 @@ static int gif_read_image(GifState *s)
pr = ptr + width;
for (px = ptr, idx = s->idx_line; px < pr; px++, idx++) {
- if (*idx != s->transparent_color_index)
- *px = pal[*idx];
+ *px = pal[*idx];
+ if (*idx == s->transparent_color_index)
+ *px &= 0xFFFFFF;
}
if (is_interleaved) {