Skip to content

Commit

Permalink
fix GHSA-whqp-q38m-3vg8 opus channel check
Browse files Browse the repository at this point in the history
  • Loading branch information
ireader committed May 8, 2022
1 parent 9a22da8 commit 44ac161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libflv/source/opus-head.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ int opus_head_load(const uint8_t* data, size_t bytes, struct opus_head_t* opus)
bytes -= 8;
}

if (bytes < 11)
// check channels: [1, 8]
if (bytes < 11 || data[1] > 8 || data[1] < 1)
return -1;

memset(opus, 0, sizeof(*opus));
Expand Down

0 comments on commit 44ac161

Please sign in to comment.