From ef83d404e54cd797a9485ce0c4359ec0e6a8b759 Mon Sep 17 00:00:00 2001 From: Leonardo Taccari Date: Mon, 6 Mar 2017 22:40:25 +0100 Subject: [PATCH] i965_decoder_utils: replace alloca(3) with malloc(3) and free(3) alloca(3) usage is less portable than malloc(3)/free(3) (this fixes issue #76 pointed out by building intel-vaapi-driver on NetBSD). Suggested and thanks to @xhaihao and @yakuizhao via pull request #77. Signed-off-by: Leonardo Taccari --- src/i965_decoder_utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c index 640fd14..dc33c60 100644 --- a/src/i965_decoder_utils.c +++ b/src/i965_decoder_utils.c @@ -23,7 +23,6 @@ #include "sysdeps.h" #include -#include #include "intel_batchbuffer.h" #include "intel_media.h" @@ -343,7 +342,7 @@ avc_get_first_mb_bit_offset_with_epb( if (buf_size > data_size) buf_size = data_size; - buf = alloca(buf_size); + buf = malloc(buf_size); ret = dri_bo_get_subdata( slice_data_bo, slice_param->slice_data_offset, buf_size, buf @@ -355,6 +354,8 @@ avc_get_first_mb_bit_offset_with_epb( i += 2, j++, n++; } + free(buf); + out_slice_data_bit_offset = in_slice_data_bit_offset + n * 8; if (mode_flag == ENTROPY_CABAC) -- 2.11.0