avcodec/h264_mc_template: prefetch list1 only if it is used in the MB
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 17 Dec 2015 23:20:51 +0000 (00:20 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 20 Dec 2015 02:24:22 +0000 (03:24 +0100)
Fixes ubsan warning
Fixes Mozilla bug 1230276

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c8ea57664fe3ad611c9ecd234670544ddff7ca55)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/h264_mc_template.c

index eaead35..e4333a7 100644 (file)
@@ -158,6 +158,7 @@ static void MCFUNC(hl_motion)(const H264Context *h, H264SliceContext *sl,
         }
     }
 
-    prefetch_motion(h, sl, 1, PIXEL_SHIFT, CHROMA_IDC);
+    if (USES_LIST(mb_type, 1))
+        prefetch_motion(h, sl, 1, PIXEL_SHIFT, CHROMA_IDC);
 }