mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Fix bug: devision by zero in ...UpdateOutput,
This commit is contained in:
parent
788636ee6b
commit
d3b98b90f4
12
video.c
12
video.c
@ -1540,6 +1540,12 @@ static void VaapiUpdateOutput(VaapiDecoder * decoder)
|
|||||||
decoder->InputWidth * input_aspect_ratio.num,
|
decoder->InputWidth * input_aspect_ratio.num,
|
||||||
decoder->InputHeight * input_aspect_ratio.den, 1024 * 1024);
|
decoder->InputHeight * input_aspect_ratio.den, 1024 * 1024);
|
||||||
|
|
||||||
|
// InputWidth/Height can be zero = uninitialized
|
||||||
|
if (!display_aspect_ratio.num || !display_aspect_ratio.den) {
|
||||||
|
display_aspect_ratio.num = 1;
|
||||||
|
display_aspect_ratio.den = 1;
|
||||||
|
}
|
||||||
|
|
||||||
Debug(3, "video: aspect %d:%d\n", display_aspect_ratio.num,
|
Debug(3, "video: aspect %d:%d\n", display_aspect_ratio.num,
|
||||||
display_aspect_ratio.den);
|
display_aspect_ratio.den);
|
||||||
|
|
||||||
@ -4450,6 +4456,12 @@ static void VdpauUpdateOutput(VdpauDecoder * decoder)
|
|||||||
decoder->InputWidth * input_aspect_ratio.num,
|
decoder->InputWidth * input_aspect_ratio.num,
|
||||||
decoder->InputHeight * input_aspect_ratio.den, 1024 * 1024);
|
decoder->InputHeight * input_aspect_ratio.den, 1024 * 1024);
|
||||||
|
|
||||||
|
// InputWidth/Height can be zero = uninitialized
|
||||||
|
if (!display_aspect_ratio.num || !display_aspect_ratio.den) {
|
||||||
|
display_aspect_ratio.num = 1;
|
||||||
|
display_aspect_ratio.den = 1;
|
||||||
|
}
|
||||||
|
|
||||||
Debug(3, "video: aspect %d:%d\n", display_aspect_ratio.num,
|
Debug(3, "video: aspect %d:%d\n", display_aspect_ratio.num,
|
||||||
display_aspect_ratio.den);
|
display_aspect_ratio.den);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user