diff mbox

[FFmpeg-devel,2/3] avfilter/drawutils: honor shift for color component description

Message ID 20160831093349.11140-2-timo@rothenpieler.org
State Accepted
Commit 2625b955a31a94d5f433ba75e933d1acf4259f13
Headers show

Commit Message

Timo Rothenpieler Aug. 31, 2016, 9:33 a.m. UTC
---
 libavfilter/drawutils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index a3710db..f6760be 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -253,7 +253,8 @@  void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4
 #define EXPAND(compn) \
         if (desc->comp[compn].depth > 8) \
             color->comp[desc->comp[compn].plane].u16[desc->comp[compn].offset] = \
-            color->comp[desc->comp[compn].plane].u8[desc->comp[compn].offset] << (draw->desc->comp[compn].depth - 8)
+            color->comp[desc->comp[compn].plane].u8[desc->comp[compn].offset] << \
+                (draw->desc->comp[compn].depth + draw->desc->comp[compn].shift - 8)
         EXPAND(3);
         EXPAND(2);
         EXPAND(1);