summaryrefslogtreecommitdiff
path: root/gst/dvbsuboverlay
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-11 13:42:02 +0200
commit76ddd498e2198aa3c879e0248acdd2fe286c206a (patch)
tree221633cc8e8de07f27ac06c0ca13d7beaaf3746a /gst/dvbsuboverlay
parenteabb238b2445084abe8aafdbb884368179b512fe (diff)
downloadgstreamer-plugins-bad-76ddd498e2198aa3c879e0248acdd2fe286c206a.tar.gz
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
Diffstat (limited to 'gst/dvbsuboverlay')
-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 6ba3c7429..21061a358 100644
--- a/gst/dvbsuboverlay/dvb-sub.c
+++ b/gst/dvbsuboverlay/dvb-sub.c
@@ -715,7 +715,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;
@@ -813,7 +813,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;
@@ -905,7 +905,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;