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

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 11722023: Validate texture sizes given to VDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 std::vector<media::PictureBuffer> buffers; 225 std::vector<media::PictureBuffer> buffers;
226 for (uint32 i = 0; i < buffer_ids.size(); ++i) { 226 for (uint32 i = 0; i < buffer_ids.size(); ++i) {
227 gpu::gles2::TextureManager::TextureInfo* info = 227 gpu::gles2::TextureManager::TextureInfo* info =
228 texture_manager->GetTextureInfo(texture_ids[i]); 228 texture_manager->GetTextureInfo(texture_ids[i]);
229 if (!info) { 229 if (!info) {
230 DLOG(FATAL) << "Failed to find texture id " << texture_ids[i]; 230 DLOG(FATAL) << "Failed to find texture id " << texture_ids[i];
231 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); 231 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
232 return; 232 return;
233 } 233 }
234 GLsizei width, height;
235 info->GetLevelSize(0, 0, &width, &height);
dwkang1 2013/01/15 08:17:46 crbug says I don't have permission for 168293. So
sheu 2013/01/15 08:25:38 It looks like you're right; I'll have to follow-up
236 if (width != sizes[i].width() || height != sizes[i].height()) {
237 DLOG(FATAL) << "Size mismatch for texture id " << texture_ids[i];
238 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
239 return;
240 }
234 if (!texture_manager->ClearRenderableLevels(command_decoder, info)) { 241 if (!texture_manager->ClearRenderableLevels(command_decoder, info)) {
235 DLOG(FATAL) << "Failed to Clear texture id " << texture_ids[i]; 242 DLOG(FATAL) << "Failed to Clear texture id " << texture_ids[i];
236 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 243 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
237 return; 244 return;
238 } 245 }
239 uint32 service_texture_id; 246 uint32 service_texture_id;
240 if (!command_decoder->GetServiceTextureId( 247 if (!command_decoder->GetServiceTextureId(
241 texture_ids[i], &service_texture_id)) { 248 texture_ids[i], &service_texture_id)) {
242 DLOG(FATAL) << "Failed to translate texture!"; 249 DLOG(FATAL) << "Failed to translate texture!";
243 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 250 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 stub_.reset(); 314 stub_.reset();
308 } 315 }
309 } 316 }
310 317
311 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { 318 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) {
312 DCHECK(sender_); 319 DCHECK(sender_);
313 return sender_->Send(message); 320 return sender_->Send(message);
314 } 321 }
315 322
316 } // namespace content 323 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698