If user set very high rank to an element (e.g., integer max),
integer overflow can happen while multiplication operation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/690>
if (v1->sink && v2->sink) {
fs1 = (GstPluginFeature *) v1->sink;
fs2 = (GstPluginFeature *) v2->sink;
- v1_rank =
- gst_plugin_feature_get_rank (fd1) * gst_plugin_feature_get_rank (fs1);
- v2_rank =
- gst_plugin_feature_get_rank (fd2) * gst_plugin_feature_get_rank (fs2);
+ v1_rank = (gint64) gst_plugin_feature_get_rank (fd1) *
+ gst_plugin_feature_get_rank (fs1);
+ v2_rank = (gint64) gst_plugin_feature_get_rank (fd2) *
+ gst_plugin_feature_get_rank (fs2);
} else {
v1_rank = gst_plugin_feature_get_rank (fd1);
v2_rank = gst_plugin_feature_get_rank (fd2);
if (v1->sink && v2->sink) {
fs1 = (GstPluginFeature *) v1->sink;
fs2 = (GstPluginFeature *) v2->sink;
- v1_rank =
- gst_plugin_feature_get_rank (fd1) * gst_plugin_feature_get_rank (fs1);
- v2_rank =
- gst_plugin_feature_get_rank (fd2) * gst_plugin_feature_get_rank (fs2);
+ v1_rank = (gint64) gst_plugin_feature_get_rank (fd1) *
+ gst_plugin_feature_get_rank (fs1);
+ v2_rank = (gint64) gst_plugin_feature_get_rank (fd2) *
+ gst_plugin_feature_get_rank (fs2);
} else {
v1_rank = gst_plugin_feature_get_rank (fd1);
v2_rank = gst_plugin_feature_get_rank (fd2);