Changeset 199764 in webkit
- Timestamp:
- Apr 19, 2016 11:02:24 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r199752 r199764 1 2016-04-19 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r198782): SHOULD NEVER BE REACHED failure in ImageSource::setData since r198782 4 https://bugs.webkit.org/show_bug.cgi?id=156690 5 6 Reviewed by Michael Catanzaro. 7 8 The assertion is wrong, because it assumes that ImageDecoder::create() always returns a valid pointer, which is 9 only true for the CG implementation. The non CG implementation can return nullptr if there isn't enough data to 10 figure out the image format or if the image format is not supported. This is causing several crashes in the 11 debug bots. 12 13 * platform/graphics/ImageSource.cpp: 14 (WebCore::ImageSource::setData): Remove the invalid ASSERT and return early if we fail to create the decoder. 15 (WebCore::ImageSource::ensureDecoderIsCreated): Deleted. 16 * platform/graphics/ImageSource.h: 17 1 18 2016-04-19 Brent Fulgham <bfulgham@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/ImageSource.cpp
r199312 r199764 72 72 } 73 73 74 void ImageSource::ensureDecoderIsCreated(const SharedBuffer& data)75 {76 if (initialized())77 return;78 79 m_decoder = ImageDecoder::create(data, m_alphaOption, m_gammaAndColorProfileOption);80 }81 82 74 void ImageSource::setData(SharedBuffer* data, bool allDataReceived) 83 75 { 84 76 if (!data) 85 77 return; 86 87 ensureDecoderIsCreated(*data); 88 78 89 79 if (!initialized()) { 90 ASSERT_NOT_REACHED(); 91 return; 80 m_decoder = ImageDecoder::create(*data, m_alphaOption, m_gammaAndColorProfileOption); 81 if (!m_decoder) 82 return; 92 83 } 93 84 94 if (m_decoder) 95 m_decoder->setData(*data, allDataReceived); 85 m_decoder->setData(*data, allDataReceived); 96 86 } 97 87 -
trunk/Source/WebCore/platform/graphics/ImageSource.h
r199312 r199764 145 145 private: 146 146 void clearFrameBufferCache(size_t); 147 void ensureDecoderIsCreated(const SharedBuffer&);148 147 SubsamplingLevel calculateMaximumSubsamplingLevel() const; 149 148 void dump(TextStream&) const;
Note: See TracChangeset
for help on using the changeset viewer.