mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
vtdec: Fix divide by zero in the picture buffer length calculation
This commit is contained in:
parent
47f3a1954e
commit
6e2e8ec0ac
1 changed files with 5 additions and 2 deletions
|
@ -726,8 +726,8 @@ compute_h264_decode_picture_buffer_length (GstVtdec * vtdec,
|
||||||
int dpb_mb_size = 16;
|
int dpb_mb_size = 16;
|
||||||
int max_dpb_size_frames = 16;
|
int max_dpb_size_frames = 16;
|
||||||
int max_dpb_mb_s = -1;
|
int max_dpb_mb_s = -1;
|
||||||
int width_in_mb_s = vtdec->video_info.width / dpb_mb_size;
|
int width_in_mb_s = GST_ROUND_UP_16 (vtdec->video_info.width) / dpb_mb_size;
|
||||||
int height_in_mb_s = vtdec->video_info.height / dpb_mb_size;
|
int height_in_mb_s = GST_ROUND_UP_16 (vtdec->video_info.height) / dpb_mb_size;
|
||||||
|
|
||||||
*length = 0;
|
*length = 0;
|
||||||
|
|
||||||
|
@ -735,6 +735,9 @@ compute_h264_decode_picture_buffer_length (GstVtdec * vtdec,
|
||||||
&profile, &level))
|
&profile, &level))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (vtdec->video_info.width == 0 || vtdec->video_info.height == 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
max_dpb_mb_s = get_dpb_max_mb_s_from_level (vtdec, level);
|
max_dpb_mb_s = get_dpb_max_mb_s_from_level (vtdec, level);
|
||||||
if (max_dpb_mb_s == -1) {
|
if (max_dpb_mb_s == -1) {
|
||||||
GST_ELEMENT_ERROR (vtdec, STREAM, DECODE, (NULL),
|
GST_ELEMENT_ERROR (vtdec, STREAM, DECODE, (NULL),
|
||||||
|
|
Loading…
Reference in a new issue