mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
siren: fix a global buffer overflow spotted by asan
This patch just enforces boudaries for the access to the standard_deviation array (64 floats). Such case can be seen with a corrupted stream, where there's no hope to obtain a valid decoded frame anyway. https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1002
This commit is contained in:
parent
7de6b5d481
commit
96004cd751
1 changed files with 4 additions and 0 deletions
|
@ -153,6 +153,10 @@ decode_envelope (int number_of_regions, float *decoder_standard_deviation,
|
||||||
|
|
||||||
absolute_region_power_index[i] =
|
absolute_region_power_index[i] =
|
||||||
absolute_region_power_index[i - 1] - index - 12;
|
absolute_region_power_index[i - 1] - index - 12;
|
||||||
|
if (absolute_region_power_index[i] < -24)
|
||||||
|
absolute_region_power_index[i] = -24;
|
||||||
|
else if (absolute_region_power_index[i] > 39)
|
||||||
|
absolute_region_power_index[i] = 39;
|
||||||
decoder_standard_deviation[i] =
|
decoder_standard_deviation[i] =
|
||||||
standard_deviation[absolute_region_power_index[i] + 24];
|
standard_deviation[absolute_region_power_index[i] + 24];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue