summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-09-10 17:24:21 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-10 17:24:21 -0700
commit05a8a80a3c294261dab8ee98b2b0792783f36aa8 (patch)
tree567761b813c25017ca0462731ff546ca4498d722
parent48f4d60622cc17afc9a1a41892434bf5347c930d (diff)
parent15a9e53fbeaf765bfa6ed795d270e5968b30acb8 (diff)
downloadmsm7k-05a8a80a3c294261dab8ee98b2b0792783f36aa8.tar.gz
am 15a9e53f: reject odd widths or heights for YV12 format
Merge commit '15a9e53fbeaf765bfa6ed795d270e5968b30acb8' * commit '15a9e53fbeaf765bfa6ed795d270e5968b30acb8': reject odd widths or heights for YV12 format
-rw-r--r--libgralloc-qsd8k/gpu.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libgralloc-qsd8k/gpu.cpp b/libgralloc-qsd8k/gpu.cpp
index d577f96..90ff445 100644
--- a/libgralloc-qsd8k/gpu.cpp
+++ b/libgralloc-qsd8k/gpu.cpp
@@ -239,8 +239,12 @@ int gpu_context_t::alloc_impl(int w, int h, int format, int usage,
break;
case HAL_PIXEL_FORMAT_YV12:
+ if ((w&1) || (h&1)) {
+ LOGE("w or h is odd for HAL_PIXEL_FORMAT_YV12");
+ return -EINVAL;
+ }
alignedw = ALIGN(w, 16);
- alignedh = ALIGN(h, 2);
+ alignedh = h;
size = alignedw*alignedh +
(ALIGN(alignedw/2, 16) * (alignedh/2))*2;
break;