diff --git a/postproc/yuv2rgb.c b/postproc/yuv2rgb.c
index 9cb65c6e6910d3c4e0abc894f0a5513c7067e125..a8acec5f196ad548ddf1b3636361a92223a2498b 100644
--- a/postproc/yuv2rgb.c
+++ b/postproc/yuv2rgb.c
@@ -642,7 +642,7 @@ static int div_round (int dividend, int divisor)
 
 int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation)
 {  
-    const int isRgb = IMGFMT_IS_RGB(c->dstFormat);
+    const int isRgb = IMGFMT_IS_BGR(c->dstFormat);
     const int bpp = isRgb?IMGFMT_RGB_DEPTH(c->dstFormat):IMGFMT_BGR_DEPTH(c->dstFormat);
     int i;
     uint8_t table_Y[1024];