codec-utils: guint8 can't hold value over 255

channels is a guint8, so the max value is 255 and checking if it value is
> 256 will never be false.

CID 1338687, CID 1338688
This commit is contained in:
Luis de Bethencourt 2015-11-12 14:39:17 +00:00
parent df16e8dd5a
commit 09c881ee14

View file

@ -1271,7 +1271,7 @@ gst_codec_utils_opus_create_caps (guint32 rate,
"coupled-count", G_TYPE_INT, coupled_count, NULL);
}
g_return_val_if_fail (channels > 0 && channels < 256, NULL);
g_return_val_if_fail (channels > 0, NULL);
g_return_val_if_fail (stream_count > 0, NULL);
g_return_val_if_fail (coupled_count <= stream_count, NULL);
g_return_val_if_fail (channel_mapping != NULL, NULL);
@ -1456,7 +1456,7 @@ gst_codec_utils_opus_create_header (guint32 rate,
channel_mapping = NULL;
} else {
g_return_val_if_fail (channels > 0 && channels < 256, NULL);
g_return_val_if_fail (channels > 0, NULL);
g_return_val_if_fail (stream_count > 0, NULL);
g_return_val_if_fail (coupled_count <= stream_count, NULL);
g_return_val_if_fail (channel_mapping != NULL, NULL);