Commit 7b2345f4 authored by liberato@chromium.org's avatar liberato@chromium.org Committed by Commit Bot

Check for null output buffer in MCVD CodecImage.

If the surface is destroyed, CodecImage will clear the codec buffer.
If something later tries to draw that image, CodecImage tried to
get the texture size from the codec buffer.

This CL adds a null check.

Bug: 835877
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I71830e0c029a1929154059e221938c332f5b9ffb
Reviewed-on: https://chromium-review.googlesource.com/1033191Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554852}
parent 1a1a7f61
......@@ -51,7 +51,10 @@ void CodecImage::SetDestructionCb(DestructionCb destruction_cb) {
}
gfx::Size CodecImage::GetSize() {
return output_buffer_->size();
// Return a nonzero size, to avoid GL errors, even if we dropped the codec
// buffer already. Note that if we dropped it, there's no data in the
// texture anyway, so the old size doesn't matter.
return output_buffer_ ? output_buffer_->size() : gfx::Size(1, 1);
}
unsigned CodecImage::GetInternalFormat() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment