summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2017-03-09 23:36:11 -0800
committerJames Zern <jzern@google.com>2017-03-10 17:37:17 -0800
commitc09b290ceadcced49e7b2ae37c24d2be0d1dd132 (patch)
tree0cf02add2f62848e1379dc388b183d09e6e3b7fb
parentf951881e8cc8487b812b2cd562fb1d9d583ec30b (diff)
downloadlibvpx-c09b290ceadcced49e7b2ae37c24d2be0d1dd132.tar
libvpx-c09b290ceadcced49e7b2ae37c24d2be0d1dd132.tar.gz
libvpx-c09b290ceadcced49e7b2ae37c24d2be0d1dd132.tar.bz2
libvpx-c09b290ceadcced49e7b2ae37c24d2be0d1dd132.zip
vp9/encoder: fix segfault on win32 using vs < 2015
shift the bsse[] member of the macroblock struct to the front to avoid an incorrect offset (0) to the upper half of bsse[0] which leads to a negative resulting in a crash. restrict this to visual studio versions before 2015 (the bug was observed with 2013, fixed in 2015) to avoid any potential cache impact on other platforms. https://connect.microsoft.com/VisualStudio/feedback/details/2396360/bad-structure-offset-in-32-bit-code BUG=webm:1054 Change-Id: I40f68a1d421ccc503cc712192263bab4f7dde076
-rw-r--r--vp9/encoder/vp9_block.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_block.h b/vp9/encoder/vp9_block.h
index c0c69f6b5..c86c818aa 100644
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -63,6 +63,11 @@ typedef struct {
typedef struct macroblock MACROBLOCK;
struct macroblock {
+// cf. https://bugs.chromium.org/p/webm/issues/detail?id=1054
+#if defined(_MSC_VER) && _MSC_VER < 1900
+ int64_t bsse[MAX_MB_PLANE << 2];
+#endif
+
struct macroblock_plane plane[MAX_MB_PLANE];
MACROBLOCKD e_mbd;
@@ -149,7 +154,10 @@ struct macroblock {
#define SKIP_TXFM_AC_DC 1
#define SKIP_TXFM_AC_ONLY 2
+// cf. https://bugs.chromium.org/p/webm/issues/detail?id=1054
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
int64_t bsse[MAX_MB_PLANE << 2];
+#endif
// Used to store sub partition's choices.
MV pred_mv[MAX_REF_FRAMES];