The fix is the one line in nsImageLoadingContent::MaybeForceSyncDecoding, but I added new asserts that should prevent this from regressing in the future. Differential Revision: https://phabricator.services.mozilla.com/D154815