h265parse: Fix to check returned value

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3968>
This commit is contained in:
Mengkejiergeli Ba 2023-02-15 13:10:39 +08:00 committed by GStreamer Marge Bot
parent 5c47002d99
commit eab15c8659

View file

@ -2170,10 +2170,16 @@ gst_h265_parse_update_src_caps (GstH265Parse * h265parse, GstCaps * caps)
&& h265parse->parsed_framerate) {
gint new_fps_num, new_fps_den;
gst_util_fraction_multiply (fps_num, fps_den, 1, 2, &new_fps_num,
&new_fps_den);
if (!gst_util_fraction_multiply (fps_num, fps_den, 1, 2, &new_fps_num,
&new_fps_den)) {
GST_WARNING_OBJECT (h265parse, "Error calculating the new framerate"
" - integer overflow; setting it to 0/1");
fps_num = 0;
fps_den = 1;
} else {
fps_num = new_fps_num;
fps_den = new_fps_den;
}
h265parse->parsed_framerate = FALSE;
}
}