Index: third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp |
index 034144fedea8f1aadc1f303bd57753a209462abf..5ed0c32cb845f5c8a4052e7b3207a22688b238b1 100644 |
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp |
@@ -101,15 +101,12 @@ static bool UpdateYUVComponentSizes(ImageDecoder* decoder, |
if (!decoder->CanDecodeToYUV()) |
return false; |
- IntSize size = decoder->DecodedYUVSize(0); |
- component_sizes[0].set(size.Width(), size.Height()); |
- component_width_bytes[0] = decoder->DecodedYUVWidthBytes(0); |
- size = decoder->DecodedYUVSize(1); |
- component_sizes[1].set(size.Width(), size.Height()); |
- component_width_bytes[1] = decoder->DecodedYUVWidthBytes(1); |
- size = decoder->DecodedYUVSize(2); |
- component_sizes[2].set(size.Width(), size.Height()); |
- component_width_bytes[2] = decoder->DecodedYUVWidthBytes(2); |
+ for (int yuv_index = 0; yuv_index < 3; ++yuv_index) { |
+ IntSize size = decoder->DecodedYUVSize(yuv_index); |
+ component_sizes[yuv_index].set(size.Width(), size.Height()); |
+ component_width_bytes[yuv_index] = decoder->DecodedYUVWidthBytes(yuv_index); |
+ } |
+ |
return true; |
} |