Firefox · DOM
CVE-2026-6784
Memory Corruption in DOM
Overview
High
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Changed Functions
| Function | Change | Notes |
|---|---|---|
ifdom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp |
modified |
Files Changed
dom/media/platforms/ffmpeg/FFmpegDataDecoder.cppdom/media/platforms/ffmpeg/FFmpegLibWrapper.cppdom/media/platforms/ffmpeg/FFmpegLibWrapper.hdom/media/test/crashtests/1536243.htmldom/media/test/crashtests/1536243.mp4dom/media/test/crashtests/crashtests.list
Patch
diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
index 6bac5b77190..e628e7f7ae9 100644
--- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp
@@ -79,7 +79,7 @@ MediaResult FFmpegDataDecoder<LIBAV_VER>::AllocateExtraData() {
FF_INPUT_BUFFER_PADDING_SIZE;
#endif
mCodecContext->extradata = static_cast<uint8_t*>(
- mLib->av_malloc(mExtraData->Length() + padding_size));
+ mLib->av_mallocz(mExtraData->Length() + padding_size));
if (!mCodecContext->extradata) {
return MediaResult(NS_ERROR_OUT_OF_MEMORY,
RESULT_DETAIL("Couldn't init ffmpeg extradata"));
diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
index 3354fab3888..1f2ffb491ec 100644
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp
@@ -216,6 +216,7 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() {
AV_FUNC(av_log_set_callback, AV_FUNC_AVUTIL_ALL)
AV_FUNC(av_log_set_level, AV_FUNC_AVUTIL_ALL)
AV_FUNC(av_malloc, AV_FUNC_AVUTIL_ALL)
+ AV_FUNC(av_mallocz, AV_FUNC_AVUTIL_ALL)
AV_FUNC(av_freep, AV_FUNC_AVUTIL_ALL)
AV_FUNC(av_frame_alloc,
(AV_FUNC_AVUTIL_55 | AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 |
diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
index aabc57d027f..448cb8d0064 100644
--- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
+++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h
@@ -132,6 +132,7 @@ struct MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS FFmpegLibWrapper {
va_list));
void (*av_log_set_level)(int level);
void* (*av_malloc)(size_t size);
+ void* (*av_mallocz)(size_t size);
void (*av_freep)(void* ptr);
int (*av_image_check_size)(unsigned int w, unsigned int h, int log_offset,
void* log_ctx);
diff --git a/dom/media/test/crashtests/1536243.html b/dom/media/test/crashtests/1536243.html
new file mode 100644
index 00000000000..97f3d0511b8
--- /dev/null
+++ b/dom/media/test/crashtests/1536243.html
@@ -0,0 +1,12 @@
+<html class="reftest-wait">
+<video id='v'>
+ <source src='1536243.mp4'>
+</video>
+<script>
+ function done() {
+ document.documentElement.removeAttribute("class");
+ }
+ v.addEventListener('error', done, true);
+ v.addEventListener('ended', done, true);
+ v.play();
+</script>
diff --git a/dom/media/test/crashtests/1536243.mp4 b/dom/media/test/crashtests/1536243.mp4
new file mode 100644
index 00000000000..02411144792
Binary files /dev/null and b/dom/media/test/crashtests/1536243.mp4 differ
diff --git a/dom/media/test/crashtests/crashtests.list b/dom/media/test/crashtests/crashtests.list
index 2e386d86e72..aaa85240cae 100644
--- a/dom/media/test/crashtests/crashtests.list
+++ b/dom/media/test/crashtests/crashtests.list
@@ -209,3 +209,6 @@ skip-if(Android) load 2016497.html
load 2017511.html
HTTP load 2014878.html
load 2014896.html
+skip-if(!winWidget) pref(media.hevc.enabled,true) load 1859400.html
+load 1603271.html
+load 1536243.html
Loading diff…
Regression Test / PoC
shipped with the fix
diff --git a/dom/media/test/crashtests/1536243.html b/dom/media/test/crashtests/1536243.html
new file mode 100644
index 00000000000..97f3d0511b8
--- /dev/null
+++ b/dom/media/test/crashtests/1536243.html
@@ -0,0 +1,12 @@
+<html class="reftest-wait">
+<video id='v'>
+ <source src='1536243.mp4'>
+</video>
+<script>
+ function done() {
+ document.documentElement.removeAttribute("class");
+ }
+ v.addEventListener('error', done, true);
+ v.addEventListener('ended', done, true);
+ v.play();
+</script>
diff --git a/dom/media/test/crashtests/1536243.mp4 b/dom/media/test/crashtests/1536243.mp4
new file mode 100644
index 00000000000..02411144792
Binary files /dev/null and b/dom/media/test/crashtests/1536243.mp4 differ
diff --git a/dom/media/test/crashtests/crashtests.list b/dom/media/test/crashtests/crashtests.list
index 2e386d86e72..aaa85240cae 100644
--- a/dom/media/test/crashtests/crashtests.list
+++ b/dom/media/test/crashtests/crashtests.list
@@ -209,3 +209,6 @@ skip-if(Android) load 2016497.html
load 2017511.html
HTTP load 2014878.html
load 2014896.html
+skip-if(!winWidget) pref(media.hevc.enabled,true) load 1859400.html
+load 1603271.html
+load 1536243.html
Loading diff…
References
On This Page