# HG changeset patch # User Wolfgang Rosenauer # Date 1567663537 -7200 # Node ID 15a995ab86c65a0f147d5ebd448a403b6da0e4cb # Parent 54482415d6bdf0d89d859da5d13c8138f1b50969# Parent a4709640638ea2ab623bad0052e94b6b14d917a9 merge from firefox68 to inherit platform fixes diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/MozillaFirefox.changes --- a/MozillaFirefox/MozillaFirefox.changes Thu Sep 05 08:04:53 2019 +0200 +++ b/MozillaFirefox/MozillaFirefox.changes Thu Sep 05 08:05:37 2019 +0200 @@ -1,7 +1,56 @@ ------------------------------------------------------------------- +Wed Sep 4 15:38:40 UTC 2019 - Wolfgang Rosenauer + +- added a bunch of patches mainly for big endian platforms + * mozilla-bmo1504834-part1.patch + * mozilla-bmo1504834-part2.patch + * mozilla-bmo1504834-part3.patch + * mozilla-bmo1511604.patch + * mozilla-bmo1554971.patch + * mozilla-bmo1573381.patch + * mozilla-nestegg-big-endian.patch + +------------------------------------------------------------------- Fri Aug 30 20:49:11 UTC 2019 - Wolfgang Rosenauer - Mozilla Firefox 68.1.0 + MFSA 2019-26 + * CVE-2019-11751 (bmo#1572838; Windows only) + Malicious code execution through command line parameters + * CVE-2019-11746 (bmo#1564449) + Use-after-free while manipulating video + * CVE-2019-11744 (bmo#1562033) + XSS by breaking out of title and textarea elements using innerHTML + * CVE-2019-11742 (bmo#1559715) + Same-origin policy violation with SVG filters and canvas to steal + cross-origin images + * CVE-2019-11736 (bmo#1551913, bmo#1552206; Windows only)) + File manipulation and privilege escalation in Mozilla Maintenance Service + * CVE-2019-11753 (bmo#1574980; Windows only) + Privilege escalation with Mozilla Maintenance Service in custom + Firefox installation location + * CVE-2019-11752 (bmo#1501152) + Use-after-free while extracting a key value in IndexedDB + * CVE-2019-9812 (bmo#1538008, bmo#1538015) + Sandbox escape through Firefox Sync + * CVE-2019-11743 (bmo#1560495) + Cross-origin access to unload event attributes + * CVE-2019-11748 (bmo#1564588) + Persistence of WebRTC permissions in a third party context + * CVE-2019-11749 (bmo#1565374) + Camera information available without prompting using getUserMedia + * CVE-2019-11750 (bmo#1568397) + Type confusion in Spidermonkey + * CVE-2019-11738 (bmo#1452037) + Content security policy bypass through hash-based sources in directives + * CVE-2019-11747 (bmo#1564481) + 'Forget about this site' removes sites from pre-loaded HSTS list + * CVE-2019-11735i (bmo#1561404,bmo#1561484,bmo#1568047,bmo#1561912, + bmo#1565744,bmo#1568858,bmo#1570358) + Memory safety bugs fixed in Firefox 69 and Firefox ESR 68.1 + * CVE-2019-11740 (bmo#1563133,bmo#1573160) + Memory safety bugs fixed in Firefox 69, Firefox ESR 68.1, and Firefox ESR 60.9 +- switched package to ESR branch - added mozilla-bmo1568145.patch to make builds reproducible - removed upstreamed patch mozilla-gcc-internal-compiler-error.patch diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/MozillaFirefox.spec --- a/MozillaFirefox/MozillaFirefox.spec Thu Sep 05 08:04:53 2019 +0200 +++ b/MozillaFirefox/MozillaFirefox.spec Thu Sep 05 08:05:37 2019 +0200 @@ -33,6 +33,8 @@ # PIE, full relro %define build_hardened 1 +%bcond_with only_print_mozconfig + # Firefox only supports i686 %ifarch %ix86 ExclusiveArch: i586 i686 @@ -134,7 +136,8 @@ License: MPL-2.0 Group: Productivity/Networking/Web/Browsers Url: http://www.mozilla.org/ -Source: http://ftp.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{orig_version}%{orig_suffix}.source.tar.xz +%if !%{with only_print_mozconfig} +Source: http://ftp.mozilla.org/pub/firefox/releases/%{version}%{orig_suffix}/source/firefox-%{orig_version}%{orig_suffix}.source.tar.xz Source1: MozillaFirefox.desktop Source2: MozillaFirefox-rpmlintrc Source3: mozilla.sh.in @@ -156,8 +159,8 @@ # please get your own set of keys. Source18: mozilla-api-key Source19: google-api-key -Source20: https://ftp.mozilla.org/pub/%{progname}/releases/%{version}/source/%{progname}-%{orig_version}%{orig_suffix}.source.tar.xz.asc -Source21: mozilla.keyring +Source20: https://ftp.mozilla.org/pub/%{progname}/releases/%{version}%{orig_suffix}/source/%{progname}-%{orig_version}%{orig_suffix}.source.tar.xz.asc +Source21: https://ftp.mozilla.org/pub/%{progname}/releases/%{version}%{orig_suffix}/KEY#/mozilla.keyring # Gecko/Toolkit Patch1: mozilla-nongnome-proxies.patch Patch2: mozilla-kde.patch @@ -174,10 +177,18 @@ Patch13: mozilla-ppc-altivec_static_inline.patch Patch14: mozilla-bmo1005535.patch Patch15: mozilla-bmo1568145.patch +Patch16: mozilla-bmo1573381.patch +Patch17: mozilla-bmo1504834-part1.patch +Patch18: mozilla-bmo1504834-part2.patch +Patch19: mozilla-bmo1504834-part3.patch +Patch20: mozilla-bmo1511604.patch +Patch21: mozilla-bmo1554971.patch +Patch22: mozilla-nestegg-big-endian.patch # Firefox/browser Patch101: firefox-kde.patch Patch102: firefox-branded-icons.patch Patch103: firefox-add-kde.js-in-order-to-survive-PGO-build.patch +%endif # only_print_mozconfig BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires(post): coreutils shared-mime-info desktop-file-utils Requires(postun): shared-mime-info desktop-file-utils @@ -267,6 +278,7 @@ symbols meant for upload to Mozilla's crash collector database. %endif +%if !%{with only_print_mozconfig} %prep %if %localize @@ -300,12 +312,21 @@ %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 # Firefox %patch101 -p1 %patch102 -p1 %patch103 -p1 +%endif # only_print_mozconfig %build +%if !%{with only_print_mozconfig} # no need to add build time to binaries modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")" DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\"" @@ -318,6 +339,8 @@ exit 1 fi source %{SOURCE5} +%endif # only_print_mozconfig + export MOZ_SOURCE_CHANGESET=$REV export SOURCE_REPO=$REPO export source_repo=$REPO @@ -348,8 +371,18 @@ %endif export CXXFLAGS="$CFLAGS" export MOZCONFIG=$RPM_BUILD_DIR/mozconfig +%if %{with only_print_mozconfig} +echo "export CC=$CC" +echo "export CXX=$CXX" +echo "export CFLAGS=\"$CFLAGS\"" +echo "export LDFLAGS=\"$LDFLAGS\"" +echo "export RUSTFLAGS=\"$RUSTFLAGS\"" +echo "" +cat << EOF +%else %limit_build -m 2000 cat << EOF > $MOZCONFIG +%endif mk_add_options MOZILLA_OFFICIAL=1 mk_add_options BUILD_OFFICIAL=1 mk_add_options MOZ_MAKE_FLAGS=%{?jobs:-j%jobs} @@ -424,7 +457,19 @@ %endif %endif EOF +%if !%{with only_print_mozconfig} +%ifarch ppc64 s390x s390 +# NOTE: Currently, system-icu is too old, so we can't build with that, +# but have to generate the .dat-file freshly. This seems to be a +# less fragile approach anyways. +# ac_add_options --with-system-icu +echo "Generate big endian version of config/external/icu/data/icud58l.dat" +./mach python intl/icu_sources_data.py . +ls -l config/external/icu/data +rm -f config/external/icu/data/icudt*l.dat +%endif xvfb-run --server-args="-screen 0 1920x1080x24" ./mach build +%endif # only_print_mozconfig %install cd $RPM_BUILD_DIR/obj @@ -448,7 +493,7 @@ # install browser prefs install -m 644 %{SOURCE6} %{buildroot}%{progdir}/browser/defaults/preferences/kde.js install -m 644 %{SOURCE9} %{buildroot}%{progdir}/browser/defaults/preferences/firefox.js -# install additional locales +# build additional locales %if %localize mkdir -p %{buildroot}%{progdir}/browser/extensions truncate -s 0 %{_tmppath}/translations.{common,other} diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/mozilla-bmo1504834-part1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-bmo1504834-part1.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,1 @@ +../mozilla-bmo1504834-part1.patch \ No newline at end of file diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/mozilla-bmo1504834-part2.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-bmo1504834-part2.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,1 @@ +../mozilla-bmo1504834-part2.patch \ No newline at end of file diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/mozilla-bmo1504834-part3.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-bmo1504834-part3.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,1 @@ +../mozilla-bmo1504834-part3.patch \ No newline at end of file diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/mozilla-bmo1511604.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-bmo1511604.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,1 @@ +../mozilla-bmo1511604.patch \ No newline at end of file diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/mozilla-bmo1554971.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-bmo1554971.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,1 @@ +../mozilla-bmo1554971.patch \ No newline at end of file diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/mozilla-bmo1573381.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-bmo1573381.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,1 @@ +../mozilla-bmo1573381.patch \ No newline at end of file diff -r 54482415d6bd -r 15a995ab86c6 MozillaFirefox/mozilla-nestegg-big-endian.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-nestegg-big-endian.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,1 @@ +../mozilla-nestegg-big-endian.patch \ No newline at end of file diff -r 54482415d6bd -r 15a995ab86c6 mozilla-bmo1504834-part1.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-bmo1504834-part1.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,81 @@ +# HG changeset patch +# Parent 051b75a600dfbf7503c3485cebfd34d4eb29be96 +Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1504834 + +diff -r 051b75a600df gfx/2d/DrawTargetSkia.cpp +--- a/gfx/2d/DrawTargetSkia.cpp Fri Jul 05 12:42:44 2019 +0200 ++++ b/gfx/2d/DrawTargetSkia.cpp Mon Jul 08 10:59:30 2019 +0200 +@@ -138,8 +138,7 @@ + return surfaceBounds.Intersect(bounds); + } + +-static const int kARGBAlphaOffset = +- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0; ++static const int kARGBAlphaOffset = 0; // Skia is always BGRA SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0; + + static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize, + const int32_t aStride, SurfaceFormat aFormat) { +diff -r 051b75a600df gfx/2d/Types.h +--- a/gfx/2d/Types.h Fri Jul 05 12:42:44 2019 +0200 ++++ b/gfx/2d/Types.h Mon Jul 08 10:59:30 2019 +0200 +@@ -85,15 +85,8 @@ + // The following values are endian-independent synonyms. The _UINT32 suffix + // indicates that the name reflects the layout when viewed as a uint32_t + // value. +-#if MOZ_LITTLE_ENDIAN + A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB + X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB +-#elif MOZ_BIG_ENDIAN +- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB +- X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB +-#else +-# error "bad endianness" +-#endif + }; + + static inline int BytesPerPixel(SurfaceFormat aFormat) { +diff -r 051b75a600df gfx/skia/skia/third_party/skcms/skcms.cc +--- a/gfx/skia/skia/third_party/skcms/skcms.cc Fri Jul 05 12:42:44 2019 +0200 ++++ b/gfx/skia/skia/third_party/skcms/skcms.cc Mon Jul 08 10:59:30 2019 +0200 +@@ -17,6 +17,8 @@ + #include + #elif defined(__SSE__) + #include ++#else ++ #define SKCMS_PORTABLE + #endif + + // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others. +@@ -124,20 +126,28 @@ + static uint16_t read_big_u16(const uint8_t* ptr) { + uint16_t be; + memcpy(&be, ptr, sizeof(be)); +-#if defined(_MSC_VER) ++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ++ return be; ++#else ++ #if defined(_MSC_VER) + return _byteswap_ushort(be); +-#else ++ #else + return __builtin_bswap16(be); ++ #endif + #endif + } + + static uint32_t read_big_u32(const uint8_t* ptr) { + uint32_t be; + memcpy(&be, ptr, sizeof(be)); +-#if defined(_MSC_VER) ++#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__ ++ return be; ++#else ++ #if defined(_MSC_VER) + return _byteswap_ulong(be); +-#else ++ #else + return __builtin_bswap32(be); ++ #endif + #endif + } + diff -r 54482415d6bd -r 15a995ab86c6 mozilla-bmo1504834-part2.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-bmo1504834-part2.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,88 @@ +# HG changeset patch +# Parent 548d0a2f3a22bfac32ec0c3921c6c969c8bf32a9 +Skia does not support big endian. The places to fix are too numerous and upstream (skia, not Mozilla) +has no interest in maintaining big endian. +So here we try to swizzle the input for skia, so that skia always works on LE, and when it comes +out again, we transform back to BE. + +diff -r 548d0a2f3a22 gfx/2d/ConvolutionFilter.cpp +--- a/gfx/2d/ConvolutionFilter.cpp Mon Jul 22 16:57:54 2019 +0200 ++++ b/gfx/2d/ConvolutionFilter.cpp Thu Jul 25 14:27:59 2019 +0200 +@@ -35,9 +35,38 @@ + return true; + } + ++static void ByteSwapArray(uint8_t *u8Array, int32_t size) { ++ uint32_t *array = reinterpret_cast(u8Array); ++ for (int pxl = 0; pxl < size; ++pxl) { ++ // Use an endian swap to move the bytes, i.e. BGRA -> ARGB. ++ uint32_t rgba = array[pxl]; ++ array[pxl] = NativeEndian::swapToLittleEndian(rgba); ++ } ++} ++ + void ConvolutionFilter::ConvolveHorizontally(const uint8_t* aSrc, uint8_t* aDst, + bool aHasAlpha) { ++#ifdef MOZ_BIG_ENDIAN ++ int outputSize = mFilter->numValues(); ++ ++ // Input size isn't handed in, so we have to calculate it quickly ++ int inputSize = 0; ++ for (int xx = 0; xx < outputSize; ++xx) { ++ // Get the filter that determines the current output pixel. ++ int filterOffset, filterLength; ++ mFilter->FilterForValue(xx, &filterOffset, &filterLength); ++ inputSize = std::max(inputSize, filterOffset + filterLength); ++ } ++ ++ ByteSwapArray((uint8_t*)aSrc, inputSize); ++#endif ++ + SkOpts::convolve_horizontally(aSrc, *mFilter, aDst, aHasAlpha); ++ ++#ifdef MOZ_BIG_ENDIAN ++ ByteSwapArray((uint8_t*)aSrc, inputSize); ++ ByteSwapArray(aDst, outputSize); ++#endif + } + + void ConvolutionFilter::ConvolveVertically(uint8_t* const* aSrc, uint8_t* aDst, +@@ -49,8 +78,26 @@ + int32_t filterLength; + auto filterValues = + mFilter->FilterForValue(aRowIndex, &filterOffset, &filterLength); ++ ++#ifdef MOZ_BIG_ENDIAN ++ for (int filterY = 0; filterY < filterLength; filterY++) { ++ // Skia only knows LE, so we have to swizzle the input ++ ByteSwapArray(aSrc[filterY], aRowSize); ++ } ++#endif ++ + SkOpts::convolve_vertically(filterValues, filterLength, aSrc, aRowSize, aDst, + aHasAlpha); ++ ++#ifdef MOZ_BIG_ENDIAN ++ // After skia is finished, we swizzle back to BE, in case ++ // the input is used again somewhere else ++ for (int filterY = 0; filterY < filterLength; filterY++) { ++ ByteSwapArray(aSrc[filterY], aRowSize); ++ } ++ // The destination array as well ++ ByteSwapArray(aDst, aRowSize); ++#endif + } + + /* ConvolutionFilter::ComputeResizeFactor is derived from Skia's +diff -r 548d0a2f3a22 gfx/skia/skia/include/core/SkPreConfig.h +--- a/gfx/skia/skia/include/core/SkPreConfig.h Mon Jul 22 16:57:54 2019 +0200 ++++ b/gfx/skia/skia/include/core/SkPreConfig.h Thu Jul 25 14:27:59 2019 +0200 +@@ -73,7 +73,7 @@ + defined(__ppc__) || defined(__hppa) || \ + defined(__PPC__) || defined(__PPC64__) || \ + defined(_MIPSEB) || defined(__ARMEB__) || \ +- defined(__s390__) || \ ++ defined(__s390__) || defined(__s390x__) || \ + (defined(__sh__) && defined(__BIG_ENDIAN__)) || \ + (defined(__ia64) && defined(__BIG_ENDIAN__)) + #define SK_CPU_BENDIAN diff -r 54482415d6bd -r 15a995ab86c6 mozilla-bmo1504834-part3.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-bmo1504834-part3.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,38 @@ +# HG changeset patch +# Parent aecb4600e5da17443b224c79eee178c1d8e155e3 +For FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the +right of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white). + +diff -r aecb4600e5da -r 49f25e4c2fd1 gfx/skia/skia/include/private/SkNx.h +--- a/gfx/skia/skia/include/private/SkNx.h Tue Aug 20 09:46:55 2019 +0200 ++++ b/gfx/skia/skia/include/private/SkNx.h Fri Aug 23 15:00:43 2019 +0200 +@@ -238,7 +238,14 @@ + AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; } + AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; } + +- AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); } ++ // On Big endian the commented out variant doesn't work, ++ // and honestly, I have no idea why it exists in the first place. ++ // The reason its broken is, I think, that it defaults to the double-variant of ToBits() ++ // which gets a 64-bit integer, and FromBits returns 32-bit, ++ // cutting off the wrong half again. ++ // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles). ++ // AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); } ++ AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; } + AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); } + AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); } + +diff -r aecb4600e5da -r 49f25e4c2fd1 gfx/skia/skia/src/opts/SkBlitMask_opts.h +--- a/gfx/skia/skia/src/opts/SkBlitMask_opts.h Tue Aug 20 09:46:55 2019 +0200 ++++ b/gfx/skia/skia/src/opts/SkBlitMask_opts.h Fri Aug 23 15:00:43 2019 +0200 +@@ -203,7 +203,9 @@ + // ~~~> + // a = 1*aa + d(1-1*aa) = aa + d(1-aa) + // c = 0*aa + d(1-1*aa) = d(1-aa) +- return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255)) ++ ++ // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0 ++ return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0)) + + d.approxMulDiv255(aa.inv()); + }; + while (h --> 0) { diff -r 54482415d6bd -r 15a995ab86c6 mozilla-bmo1511604.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-bmo1511604.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,54 @@ +# HG changeset patch +# User A. Wilcox +# Date 1543674229 0 +# Sat Dec 01 14:23:49 2018 +0000 +# Node ID 0309ff19e46b126c527e633518d7de8570442114 +# Parent 53107afbc21ec78e7ac46d37af212505f2032d5d +Bug 1511604 - Swizzle YCbCr->RGB data on big-endian machines +Taken from https://bugzilla.mozilla.org/show_bug.cgi?id=1511604 + +This is very closely related to mozilla-bmo1504834 + +Again, input for skia is swizzled to LE, as skia only understands LE. + +diff -r 53107afbc21e -r 0309ff19e46b gfx/ycbcr/YCbCrUtils.cpp +--- a/gfx/ycbcr/YCbCrUtils.cpp Wed Nov 07 04:50:21 2018 +0000 ++++ b/gfx/ycbcr/YCbCrUtils.cpp Sat Dec 01 14:23:49 2018 +0000 +@@ -3,7 +3,9 @@ + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + ++#include "mozilla/EndianUtils.h" + #include "gfx2DGlue.h" ++#include "mozilla/gfx/Swizzle.h" + + #include "YCbCrUtils.h" + #include "yuv_convert.h" +@@ -236,6 +238,13 @@ + yuvtype, + srcData.mYUVColorSpace); + } ++#ifdef MOZ_BIG_ENDIAN ++ // libyuv makes endian-correct result, which needs to be swapped to BGRX ++ if (aDestFormat != SurfaceFormat::R5G6B5_UINT16) ++ gfx::SwizzleData(aDestBuffer, aStride, gfx::SurfaceFormat::X8R8G8B8, ++ aDestBuffer, aStride, gfx::SurfaceFormat::B8G8R8X8, ++ srcData.mPicSize); ++#endif + } + + void +@@ -257,6 +266,12 @@ + aSrcStrideYA, + aSrcStrideUV, + aDstStrideARGB); ++#ifdef MOZ_BIG_ENDIAN ++ // libyuv makes endian-correct result, which needs to be swapped to BGRA ++ gfx::SwizzleData(aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::A8R8G8B8, ++ aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::B8G8R8A8, ++ IntSize(aWidth, aHeight)); ++#endif + } + + } // namespace gfx + diff -r 54482415d6bd -r 15a995ab86c6 mozilla-bmo1554971.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-bmo1554971.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,22 @@ +# HG changeset patch +# Parent a25cebecb02d5460b8ad757fe9cb4a9c8d1d7658 +Eliminate startup error message: +JavaScript error: , line 0: Error: Type error for platformInfo value (Error processing arch: Invalid enumeration value "s390x") for runtime.getPlatformInfo. + +Reported here: https://bugzilla.mozilla.org/show_bug.cgi?id=1554971 + +Uncertain if this is causing real problems or not. Also uncertain if the fix actually fixes anything. +No response from upstream yet. + +diff -r a25cebecb02d -r 378b81b00e73 toolkit/components/extensions/schemas/runtime.json +--- a/toolkit/components/extensions/schemas/runtime.json Fri Jul 05 12:42:44 2019 +0200 ++++ b/toolkit/components/extensions/schemas/runtime.json Fri Jul 19 13:19:30 2019 +0200 +@@ -64,7 +64,7 @@ + { + "id": "PlatformArch", + "type": "string", +- "enum": ["arm", "x86-32", "x86-64"], ++ "enum": ["arm", "x86-32", "x86-64", "s390x", "aarch64", "ppc64le"], + "allowedContexts": ["content", "devtools"], + "description": "The machine's processor architecture." + }, diff -r 54482415d6bd -r 15a995ab86c6 mozilla-bmo1573381.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-bmo1573381.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,22 @@ +# HG changeset patch +# Parent 45680ce4ca06795cbca1ea5a9ae8a7a11ab95cf1 +The code tries to find a codec in a list of codecs. For this it searches for a given prefix. +But the prefix is of type char16_t, which means 2 bytes per character instead of 1, as was compared here. +On big endian this created some false positives, as the order of bytes is different and some characters only +occupy "the first" byte, having the second null'ed out. +Noticed because of gtest: MediaMIMETypes.MediaCodecs + +Upstream bugreport: https://bugzilla.mozilla.org/show_bug.cgi?id=1573381 + +diff -r 45680ce4ca06 -r 381102061fcc dom/media/MediaMIMETypes.cpp +--- a/dom/media/MediaMIMETypes.cpp Mon Aug 05 09:28:53 2019 +0200 ++++ b/dom/media/MediaMIMETypes.cpp Tue Aug 13 07:51:27 2019 +0200 +@@ -87,7 +87,7 @@ + const size_t prefixLength = aCodecPrefix.Length(); + for (const auto& myCodec : Range()) { + if (myCodec.Length() >= prefixLength && +- memcmp(myCodec.Data(), aCodecPrefix.Data(), prefixLength) == 0) { ++ memcmp(myCodec.Data(), aCodecPrefix.Data(), prefixLength * sizeof(char16_t)) == 0) { + return true; + } + } diff -r 54482415d6bd -r 15a995ab86c6 mozilla-nestegg-big-endian.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-nestegg-big-endian.patch Thu Sep 05 08:05:37 2019 +0200 @@ -0,0 +1,38 @@ +# HG changeset patch +# Parent 381102061fccdec40efda75c7423a766f68201ba +Bug-behavior: Youtube-videos using VP9 and opus as audio-codec started loading but did not play +Reason: While parsing the audio-stream, the sampling frequency (short rate) was wrongly parsed by + nestegg, returning 0 all the time. This led to the audio-track reporting that it neither had + valid video nor audio. Which led to an endless-loop in the video state machine. +Solution: Correct parsing of rate in nestegg, which is a float and cuts of bytes. +Link: https://github.com/kinetiknz/nestegg/issues/64 + +diff -r 381102061fcc -r 8da4be020b1e media/libnestegg/src/nestegg.c +--- a/media/libnestegg/src/nestegg.c Tue Aug 13 07:51:27 2019 +0200 ++++ b/media/libnestegg/src/nestegg.c Tue Aug 20 07:59:54 2019 +0200 +@@ -768,7 +768,15 @@ + { + union { + uint64_t u; +- float f; ++ struct { ++#if __FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__ ++ uint32_t _pad; ++ float f; ++#else ++ float f; ++ uint32_t _pad; ++#endif ++ } f; + double d; + } value; + int r; +@@ -780,7 +788,7 @@ + if (r != 1) + return r; + if (length == 4) +- *val = value.f; ++ *val = value.f.f; + else + *val = value.d; + return 1; diff -r 54482415d6bd -r 15a995ab86c6 series --- a/series Thu Sep 05 08:04:53 2019 +0200 +++ b/series Thu Sep 05 08:05:37 2019 +0200 @@ -14,6 +14,13 @@ mozilla-ppc-altivec_static_inline.patch mozilla-bmo1005535.patch mozilla-bmo1568145.patch +mozilla-bmo1573381.patch +mozilla-bmo1504834-part3.patch +mozilla-bmo1504834-part2.patch +mozilla-bmo1504834-part1.patch +mozilla-bmo1511604.patch +mozilla-bmo1554971.patch +mozilla-nestegg-big-endian.patch # Firefox patches firefox-kde.patch