Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit decode calls to a maximum of 100 to prevent potential timeouts with fuzzers #103

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion fuzzer/svc_dec_fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ void Codec::allocFrame()
void Codec::decodeHeader(const uint8_t *data, size_t size)
{
setParams(IVD_DECODE_HEADER);
while(size > 0)
size_t numDecodeCalls = 0;
while(size > 0 && numDecodeCalls < kMaxNumDecodeCalls)
{
IV_API_CALL_STATUS_T ret;
isvcd_video_decode_ip_t s_video_decode_ip;
Expand All @@ -339,6 +340,7 @@ void Codec::decodeHeader(const uint8_t *data, size_t size)

data += bytes_consumed;
size -= bytes_consumed;
numDecodeCalls++;

mWidth = std::min(s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_wd, (UWORD32) 10240);
mHeight = std::min(s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_ht, (UWORD32) 10240);
Expand Down
Loading