New issue
Advanced search Search tips

Issue 892683 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Broken rendering for ico image with "Allow animated images, but only once."

Project Member Reported by khushals...@chromium.org, Oct 5

Issue description

Chrome Version: 69.0.3497.100
OS: Linux

What steps will reproduce the problem?
* Install the extension (https://chrome.google.com/webstore/detail/animation-policy/ncigbofjfbodhkaffojakplpmnleeoee?hl=en-US) in Chrome

* Configure animation policy to "Allow animated images, but only once."

* It may be necessary to restart Chrome

* Load https://raspberrypi.stackexchange.com/favicon.ico (it is a redirect)

The image will animate and then stop in a corrupted state. I can repro locally and I think its an issue with the decoder. I'll debug some more.
 
Cc: yn...@vivaldi.com
Seems like an issue with the IcoDecoder. Running it with a debug build, I'm hitting this DCHECK,

[1:10:1005/101407.175829:FATAL:image_decoder_wrapper.cc(169)] Check failed: scaled_size_bitmap.width() == scaled_size_.width() (16 vs. 32)
#0 0x7f96ea60905f base::debug::StackTrace::StackTrace()
#1 0x7f96ea532f4b logging::LogMessage::~LogMessage()
#2 0x7f96e01c5102 blink::ImageDecoderWrapper::Decode()
#3 0x7f96e01cc64f blink::ImageFrameGenerator::DecodeAndScale()
#4 0x7f96e0163218 blink::DecodingImageGenerator::GetPixels()
#5 0x7f96e9660df6 cc::PaintImage::DecodeFromGenerator()
#6 0x7f96e9660c56 cc::PaintImage::Decode()
#7 0x7f96da4fc343 cc::SoftwareImageDecodeCacheUtils::DoDecodeImage()
#8 0x7f96da4f72f8 cc::SoftwareImageDecodeCache::DecodeImageIfNecessary()
#9 0x7f96da4f6ce3 cc::SoftwareImageDecodeCache::DecodeImageInTask()
#10 0x7f96da4f9d1a cc::(anonymous namespace)::SoftwareImageDecodeTaskImpl::RunOnWorkerThread()
#11 0x7f96e80cadda content::CategorizedWorkerPool::RunTaskInCategoryWithLockAcquired()
#12 0x7f96e80c9a3c content::CategorizedWorkerPool::Run()
#13 0x7f96ea5cf074 base::SimpleThread::ThreadMain()
#14 0x7f96ea61f76f base::(anonymous namespace)::ThreadFunc()
#15 0x7f96de3ba494 start_thread
#16 0x7f96dc30da8f clone

The bitmap produced by the decoder doesn't match the image size. Interestingly this only happens with the "Allow animated images, but only once." policy.
Found it. Ico never says its animated and uses the image with the largest size in the set, but we were incorrectly animating it with the animation policy override. Fix up: https://chromium-review.googlesource.com/c/chromium/src/+/1265080
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c61cdacd6cbccfc9b1552c2a9b45fe968b2bddc7

commit c61cdacd6cbccfc9b1552c2a9b45fe968b2bddc7
Author: Khushal <khushalsagar@google.com>
Date: Fri Oct 05 22:27:04 2018

blink/images: Respect both the repetition count and animation policy.

Use the conservative of the repetition count specified by the image and
the animation policy when selecting the final repetition count for
animated images.

R=chrishtr@chromium.org

Bug:  892683 
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I32507feca552302cca43db4ccbbb0ba9c82ca152
Reviewed-on: https://chromium-review.googlesource.com/c/1265080
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597344}
[modify] https://crrev.com/c61cdacd6cbccfc9b1552c2a9b45fe968b2bddc7/third_party/blink/renderer/platform/graphics/bitmap_image.cc
[modify] https://crrev.com/c61cdacd6cbccfc9b1552c2a9b45fe968b2bddc7/third_party/blink/renderer/platform/graphics/bitmap_image_test.cc

Status: Fixed (was: Assigned)

Sign in to add a comment