diff mbox

[FFmpeg-devel,3/3] avcodec/vaapi: mask unused bits in bitplane_present.value

Message ID 727ea44a-88ab-34ae-5881-c1e5afa47e58@carpalis.nl
State Superseded
Headers show

Commit Message

Jerome Borsboom Feb. 25, 2018, 1:23 p.m. UTC
Due to the union construct, unused bits in bitplane_present.value might
be uninitialized even when the used bits are all set to a value.
Masking the unused bits prevents spurious true values when all used
bits are unset, e.g. skipped pictures.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
---
  libavcodec/vaapi_vc1.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
index a137979dd4..e93b7285e3 100644
--- a/libavcodec/vaapi_vc1.c
+++ b/libavcodec/vaapi_vc1.c
@@ -387,7 +387,7 @@  static int vaapi_vc1_start_frame(AVCodecContext 
*avctx, av_unused const uint8_t
      if (err)
          goto fail;
  -    if (pic_param.bitplane_present.value) {
+    if (pic_param.bitplane_present.value & 0x7f) {
          uint8_t *bitplane;
          const uint8_t *ff_bp[3];
          int x, y, n;