Limit max frame size in DAV1D decoder

Bug: chromium:325284120
Change-Id: Iea0aea0a17bb0b1f73b3c1cbd408b7a6cd2b216e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340180
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41776}
This commit is contained in:
Sergey Silkin 2024-02-21 10:35:54 +01:00 committed by WebRTC LUCI CQ
parent 88a8e44a51
commit 74a4038ead

View File

@ -87,6 +87,8 @@ bool Dav1dDecoder::Configure(const Settings& settings) {
s.n_threads = std::max(2, settings.number_of_cores());
s.max_frame_delay = 1; // For low latency decoding.
s.all_layers = 0; // Don't output a frame for every spatial layer.
// Limit max frame size to avoid OOM'ing fuzzers. crbug.com/325284120.
s.frame_size_limit = 16384 * 16384;
s.operating_point = 31; // Decode all operating points.
return dav1d_open(&context_, &s) == 0;