diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index afe3f13c68f4533afd3e9475ed6e1fb4f17c3c1c..21a16e91b2d870c96e1daf8539e30e99d94cd20a 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -381,11 +381,10 @@ static inline void doHorizLowPass_C(uint8_t dst[], int stride, const PPContext *
 static inline void horizX1Filter(uint8_t *src, int stride, int QP)
 {
     int y;
-    static uint64_t *lut= NULL;
-    if(lut==NULL)
+    static uint64_t lut[256];
+    if(!lut[255])
     {
         int i;
-        lut = av_malloc(256*8);
         for(i=0; i<256; i++)
         {
             int v= i < 128 ? 2*i : 2*(i-256);