mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Increment the fetch generation when cancelling media fetch
The case of an unsupported format error wasn't covered for this, meaning that it could crash if the fetch completed successfully after the fetch was cancelled due to such an error. A crash test is included for this issue, using an echo of a large corrupted WebM file to ensure that the fetch completes after media init.
This commit is contained in:
committed by
Alexander Kalenik
parent
6a46bcaf35
commit
84e0b7d36f
Notes:
github-actions[bot]
2026-04-08 11:04:31 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/84e0b7d36f2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8812
@@ -1782,12 +1782,11 @@ void HTMLMediaElement::set_up_playback_manager_for_remote()
|
||||
|
||||
// 1. The user agent should cancel the fetching process.
|
||||
VERIFY(self->m_remote_fetch_data);
|
||||
auto fetch_data = move(self->m_remote_fetch_data);
|
||||
if (fetch_data->fetch_controller)
|
||||
fetch_data->fetch_controller->stop_fetch();
|
||||
auto failure_callback = move(self->m_remote_fetch_data->failure_callback);
|
||||
self->cancel_the_fetching_process();
|
||||
|
||||
// 2. Abort this subalgorithm, returning to the resource selection algorithm.
|
||||
fetch_data->failure_callback(MUST(String::from_utf8(error.description())));
|
||||
failure_callback(MUST(String::from_utf8(error.description())));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user