media/filters/VP9Parser: Fix underflow for q_index

FeatureData[segment_id][SEG_LVL_ALT_Q] can be negative. Therefore, base_q_idx +
FeatureData[segment_id][SEG_LVL_ALT_Q] can be less than 0. The original VP9
parser code stores the value in size_t. It leads underflow of size_t and then
ClampQ returns 255. It should return 0 for the negative value.

Bug: 915498
Test: No wrong video frame for some issue video on eve
Change-Id: I6cfecc19aeeef60f246ffab5d6bf5f8420d1cd1b
Commit-Queue: Hirokazu Honda <>
Reviewed-by: Dale Curtis <>
Reviewed-by: Kuang-che Wu <>
Cr-Commit-Position: refs/heads/master@{#625017}
2 files changed