pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

intel-vaapi-driver: avoid alloca(3) uses replacing it with malloc(3) and free(3)



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Tue Mar 7 10:45:02 2017 +0100
Changeset:	5393f53a313ec5dfb3c6af6cd91ca58ab722f820

Modified Files:
	intel-vaapi-driver/distinfo
	intel-vaapi-driver/patches/patch-src_i965__decoder__utils.c
Removed Files:
	intel-vaapi-driver/patches/patch-configure.ac

Log Message:
intel-vaapi-driver: avoid alloca(3) uses replacing it with malloc(3) and free(3)

Suggested by upstream via pull request #77.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=5393f53a313ec5dfb3c6af6cd91ca58ab722f820

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 intel-vaapi-driver/distinfo                        |  3 +-
 intel-vaapi-driver/patches/patch-configure.ac      | 15 ---------
 .../patches/patch-src_i965__decoder__utils.c       | 36 ++++++++++++++--------
 3 files changed, 24 insertions(+), 30 deletions(-)

diffs:
diff --git a/intel-vaapi-driver/distinfo b/intel-vaapi-driver/distinfo
index c26cb5d58b..e0c49f4f72 100644
--- a/intel-vaapi-driver/distinfo
+++ b/intel-vaapi-driver/distinfo
@@ -4,5 +4,4 @@ SHA1 (intel-vaapi-driver-1.7.3.tar.gz) = f2f412edc9d03567897b187d96343db68598fa3
 RMD160 (intel-vaapi-driver-1.7.3.tar.gz) = 2ba7c3d945733bf56f234fc5451422173a612f1d
 SHA512 (intel-vaapi-driver-1.7.3.tar.gz) = 57ae4fbf1bd5799e8a311fcd67eda1a8a6d5b5267df502b83f63f8bd0cdd510a4f78b4d09088833bfa2e98447d841c3d4e7229f4e75a9d9f4b8096fb14027878
 Size (intel-vaapi-driver-1.7.3.tar.gz) = 1648659 bytes
-SHA1 (patch-configure.ac) = d6bf94e7799e515cd6b848c50555b8d3098c36f5
-SHA1 (patch-src_i965__decoder__utils.c) = aca1b4c8bb46a52c4887a4b2d1f74ff4fd08cabe
+SHA1 (patch-src_i965__decoder__utils.c) = a656843fb981a1dd1b2592ef5a7aace589ea550a
diff --git a/intel-vaapi-driver/patches/patch-configure.ac b/intel-vaapi-driver/patches/patch-configure.ac
deleted file mode 100644
index 819e80f4bd..0000000000
--- a/intel-vaapi-driver/patches/patch-configure.ac
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Check for alloca(3) in order to do the proper dance in source codes
-that uses it.
-
---- configure.ac.orig	2016-11-10 05:04:36.000000000 +0000
-+++ configure.ac
-@@ -74,6 +74,7 @@ AC_PROG_CXX
- AC_C_BIGENDIAN
- AC_HEADER_STDC
- AC_SYS_LARGEFILE
-+AC_FUNC_ALLOCA
- AC_CHECK_LIB([m], [sin])
- AC_CHECK_FUNCS([log2f])
- AC_CHECK_PROGS([PYTHON2], [python2 python])
diff --git a/intel-vaapi-driver/patches/patch-src_i965__decoder__utils.c b/intel-vaapi-driver/patches/patch-src_i965__decoder__utils.c
index 2439201755..ef208441d3 100644
--- a/intel-vaapi-driver/patches/patch-src_i965__decoder__utils.c
+++ b/intel-vaapi-driver/patches/patch-src_i965__decoder__utils.c
@@ -1,25 +1,35 @@
 $NetBSD$
 
-Honor AC_FUNC_ALLOCA and include the proper header files to use alloca(3).
+Use malloc(3) and free(3) instead of alloca(3).
+
+Suggested by upstream via issue pull request #77.
 
 --- src/i965_decoder_utils.c.orig	2016-11-10 05:04:36.000000000 +0000
 +++ src/i965_decoder_utils.c
-@@ -23,7 +23,17 @@
+@@ -23,7 +23,6 @@
  
  #include "sysdeps.h"
  #include <limits.h>
 -#include <alloca.h>
-+#ifdef STDC_HEADERS
-+# include <stdlib.h>
-+# include <stddef.h>
-+#else
-+# ifdef HAVE_STDLIB_H
-+#  include <stdlib.h>
-+# endif
-+#endif
-+#ifdef HAVE_ALLOCA_H
-+# include <alloca.h>
-+#endif
  
  #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,9 @@ avc_get_first_mb_bit_offset_with_epb(
+             i += 2, j++, n++;
+     }
+ 
++    if (buf)
++        free(buf);
++
+     out_slice_data_bit_offset = in_slice_data_bit_offset + n * 8;
+ 
+     if (mode_flag == ENTROPY_CABAC)


Home | Main Index | Thread Index | Old Index