mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 10:40:34 +00:00
audio: Extend guards in functions to also cover negative/unknown out of bounds DSD formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4966>
This commit is contained in:
parent
6b47a37ed8
commit
44ffb80a32
1 changed files with 6 additions and 3 deletions
|
@ -581,7 +581,8 @@ gst_dsd_info_to_caps (const GstDsdInfo * info)
|
|||
GstAudioFlags flags;
|
||||
|
||||
g_return_val_if_fail (info != NULL, NULL);
|
||||
g_return_val_if_fail (info->format < GST_NUM_DSD_FORMATS, NULL);
|
||||
g_return_val_if_fail (info->format > GST_DSD_FORMAT_UNKNOWN
|
||||
&& info->format < GST_NUM_DSD_FORMATS, NULL);
|
||||
g_return_val_if_fail (info->rate >= 1, NULL);
|
||||
g_return_val_if_fail (info->channels >= 1, NULL);
|
||||
|
||||
|
@ -1002,8 +1003,10 @@ gst_dsd_convert (const guint8 * input_data, guint8 * output_data,
|
|||
{
|
||||
g_return_if_fail (input_data != NULL);
|
||||
g_return_if_fail (output_data != NULL);
|
||||
g_return_if_fail (input_format < GST_NUM_DSD_FORMATS);
|
||||
g_return_if_fail (output_format < GST_NUM_DSD_FORMATS);
|
||||
g_return_if_fail (input_format > GST_DSD_FORMAT_UNKNOWN
|
||||
&& input_format < GST_NUM_DSD_FORMATS);
|
||||
g_return_if_fail (output_format > GST_DSD_FORMAT_UNKNOWN
|
||||
&& output_format < GST_NUM_DSD_FORMATS);
|
||||
g_return_if_fail (input_layout == GST_AUDIO_LAYOUT_INTERLEAVED
|
||||
|| input_plane_offsets != NULL);
|
||||
g_return_if_fail (output_layout == GST_AUDIO_LAYOUT_INTERLEAVED
|
||||
|
|
Loading…
Reference in a new issue