summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <mart.raudsepp@collabora.com>2011-12-21 13:00:27 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-07-09 18:19:12 +0200
commita908339fee1e641961764f3281720aca1e414630 (patch)
tree8a44f72596e280cbe5c82e94200c452dc3d847c9
parent0687a65eea23f6ec826cc6db2236a3d821afa7ad (diff)
dvbsuboverlay: Handle non_modifying_colour_flag correctly in the RLE handlers
The check for when to not memset was checking on an undeterministic 'bits' variable value, which is only meant to be used inside the loop earlier when it is supposed to check if clut_index is 1 together with non_mod set, as per spec: "non_modifying_colour_flag: If set to '1' this indicates that the CLUT entry value '1' is a non modifying colour. When the non modifying colour is assigned to an object pixel, then the pixel of the underlying region background or object shall not be modified. This can be used to create "transparent holes" in objects." https://bugzilla.gnome.org/show_bug.cgi?id=666352
-rw-r--r--gst/dvbsuboverlay/dvb-sub.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/dvbsuboverlay/dvb-sub.c b/gst/dvbsuboverlay/dvb-sub.c
index 3431a8cfe..097268bee 100644
--- a/gst/dvbsuboverlay/dvb-sub.c
+++ b/gst/dvbsuboverlay/dvb-sub.c
@@ -714,7 +714,7 @@ _dvb_sub_read_2bit_string (guint8 * destbuf, gint dbuf_len,
GST_TRACE ("RUNLEN: setting %u pixels to color 0x%x in destination buffer, "
"dbuf_len left is %d pixels", run_length, clut_index, dbuf_len);
- if (!(non_mod == 1 && bits == 1))
+ if (!(non_mod == 1 && clut_index == 1))
memset (destbuf, clut_index, run_length);
destbuf += run_length;
@@ -811,7 +811,7 @@ _dvb_sub_read_4bit_string (guint8 * destbuf, gint dbuf_len,
GST_TRACE ("RUNLEN: setting %u pixels to color 0x%x in destination buffer; "
"dbuf_len left is %d pixels", run_length, clut_index, dbuf_len);
- if (!(non_mod == 1 && bits == 1))
+ if (!(non_mod == 1 && clut_index == 1))
memset (destbuf, clut_index, run_length);
destbuf += run_length;
@@ -903,7 +903,7 @@ _dvb_sub_read_8bit_string (guint8 * destbuf, gint dbuf_len,
GST_TRACE ("RUNLEN: setting %u pixels to color 0x%x in destination buffer; "
"dbuf_len left is %d pixels", run_length, clut_index, dbuf_len);
- if (!(non_mod == 1 && bits == 1))
+ if (!(non_mod == 1 && clut_index == 1))
memset (destbuf, clut_index, run_length);
destbuf += run_length;