Skip to content

Commit

Permalink
Limit decode calls to a maximum of 100 to prevent potential timeouts …
Browse files Browse the repository at this point in the history
…with fuzzers
  • Loading branch information
MallikarjunKamble committed Jul 19, 2024
1 parent 3899610 commit ec6cd77
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit ec6cd77

Please sign in to comment.