Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: source/libvpx/vpx/src/vpx_image.c

Issue 394353005: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vpx/src/svc_encodeframe.c ('k') | source/libvpx/vpx/vp8cx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vpx/src/vpx_image.c
===================================================================
--- source/libvpx/vpx/src/vpx_image.c (revision 284462)
+++ source/libvpx/vpx/src/vpx_image.c (working copy)
@@ -12,6 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include "vpx/vpx_image.h"
+#include "vpx/vpx_integer.h"
#define ADDRESS_STORAGE_SIZE sizeof(size_t)
/*returns an addr aligned to the byte boundary specified by align*/
@@ -165,8 +166,13 @@
img->img_data = img_data;
if (!img_data) {
- img->img_data = img_buf_memalign(buf_align, ((fmt & VPX_IMG_FMT_PLANAR) ?
- h * s * bps / 8 : h * s));
+ const uint64_t alloc_size = (fmt & VPX_IMG_FMT_PLANAR) ?
+ (uint64_t)h * s * bps / 8 : (uint64_t)h * s;
+
+ if (alloc_size != (size_t)alloc_size)
+ goto fail;
+
+ img->img_data = img_buf_memalign(buf_align, (size_t)alloc_size);
img->img_data_owner = 1;
}
« no previous file with comments | « source/libvpx/vpx/src/svc_encodeframe.c ('k') | source/libvpx/vpx/vp8cx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698