projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35064fd
)
textoverlay: fix comparison is always false due to limited range of data type
author
Josep Torra
<n770galaxy@gmail.com>
Fri, 1 Apr 2011 13:33:42 +0000
(15:33 +0200)
committer
Sebastian Dröge
<sebastian.droege@collabora.co.uk>
Fri, 1 Apr 2011 13:47:03 +0000
(15:47 +0200)
Perform calculation in a temp var with enough room as there's guarantee that
ret will be able to hold the result for example in _blit_AYUV.
ext/pango/gsttextoverlay.c
patch
|
blob
|
history
diff --git
a/ext/pango/gsttextoverlay.c
b/ext/pango/gsttextoverlay.c
index
21ac013
..
914c216
100644
(file)
--- a/
ext/pango/gsttextoverlay.c
+++ b/
ext/pango/gsttextoverlay.c
@@
-145,8
+145,9
@@
GST_DEBUG_CATEGORY (pango_debug);
#define OVER(ret, alphaA, Ca, alphaB, Cb, alphaNew) \
{ \
- ret = (Ca * alphaA + Cb * alphaB * (255 - alphaA) / 255) / alphaNew; \
- ret = CLAMP (ret, 0, 255); \
+ gint _tmp; \
+ _tmp = (Ca * alphaA + Cb * alphaB * (255 - alphaA) / 255) / alphaNew; \
+ ret = CLAMP (_tmp, 0, 255); \
}
#if G_BYTE_ORDER == G_LITTLE_ENDIAN