⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176474 in webkit


Ignore:
Timestamp:
Nov 21, 2014, 3:10:59 PM (12 years ago)
Author:
timothy_horton@apple.com
Message:

Crashes while encoding a TextIndicator with no contentImageWithHighlight
https://bugs.webkit.org/show_bug.cgi?id=138984
<rdar://problem/19063717>

Reviewed by Sam Weinig.

  • Shared/WebCoreArgumentCoders.cpp:

(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
encodeImage doesn't deal with null images, so handle that case gracefully.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r176463 r176474  
     12014-11-21  Tim Horton  <timothy_horton@apple.com>
     2
     3        Crashes while encoding a TextIndicator with no contentImageWithHighlight
     4        https://bugs.webkit.org/show_bug.cgi?id=138984
     5        <rdar://problem/19063717>
     6
     7        Reviewed by Sam Weinig.
     8
     9        * Shared/WebCoreArgumentCoders.cpp:
     10        (IPC::ArgumentCoder<TextIndicatorData>::encode):
     11        (IPC::ArgumentCoder<TextIndicatorData>::decode):
     12        encodeImage doesn't deal with null images, so handle that case gracefully.
     13
    1142014-11-21  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp

    r176462 r176474  
    19691969    encoder << textIndicatorData.contentImageScaleFactor;
    19701970    encoder.encodeEnum(textIndicatorData.presentationTransition);
    1971     encodeImage(encoder, textIndicatorData.contentImage.get());
    1972     encodeImage(encoder, textIndicatorData.contentImageWithHighlight.get());
     1971
     1972    bool hasImage = textIndicatorData.contentImage;
     1973    encoder << hasImage;
     1974    if (hasImage)
     1975        encodeImage(encoder, textIndicatorData.contentImage.get());
     1976
     1977    bool hasImageWithHighlight = textIndicatorData.contentImageWithHighlight;
     1978    encoder << hasImageWithHighlight;
     1979    if (hasImageWithHighlight)
     1980        encodeImage(encoder, textIndicatorData.contentImageWithHighlight.get());
    19731981}
    19741982
     
    19901998        return false;
    19911999
    1992     if (!decodeImage(decoder, textIndicatorData.contentImage))
    1993         return false;
    1994 
    1995     if (!decodeImage(decoder, textIndicatorData.contentImageWithHighlight))
     2000    bool hasImage;
     2001    if (!decoder.decode(hasImage))
     2002        return false;
     2003    if (hasImage && !decodeImage(decoder, textIndicatorData.contentImage))
     2004        return false;
     2005
     2006    bool hasImageWithHighlight;
     2007    if (!decoder.decode(hasImageWithHighlight))
     2008        return false;
     2009    if (hasImageWithHighlight && !decodeImage(decoder, textIndicatorData.contentImageWithHighlight))
    19962010        return false;
    19972011
Note: See TracChangeset for help on using the changeset viewer.