summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-01-13 10:04:26 +0100
committerJohns <johns98@gmx.net>2012-01-13 10:04:26 +0100
commitd3b98b90f47846a788d11f4bebb5a30a544926e9 (patch)
tree33c5867779e5a5ca5678c561f180ff21b2be5c95
parent788636ee6bf15447b20d7b85f7bb07e77971f0a3 (diff)
downloadvdr-plugin-softhddevice-d3b98b90f47846a788d11f4bebb5a30a544926e9.tar.gz
vdr-plugin-softhddevice-d3b98b90f47846a788d11f4bebb5a30a544926e9.tar.bz2
Fix bug: devision by zero in ...UpdateOutput,
-rw-r--r--video.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/video.c b/video.c
index 7c9d3a0..a48222e 100644
--- a/video.c
+++ b/video.c
@@ -1540,6 +1540,12 @@ static void VaapiUpdateOutput(VaapiDecoder * decoder)
decoder->InputWidth * input_aspect_ratio.num,
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,
display_aspect_ratio.den);
@@ -3991,7 +3997,7 @@ static void VdpauExitOutputQueue(void)
Debug(4, "video/vdpau: destroy output surface with id 0x%08x\n",
VdpauSurfacesRb[i]);
- if ( VdpauSurfacesRb[i] != VDP_INVALID_HANDLE ) {
+ if (VdpauSurfacesRb[i] != VDP_INVALID_HANDLE) {
status = VdpauOutputSurfaceDestroy(VdpauSurfacesRb[i]);
if (status != VDP_STATUS_OK) {
Error(_("video/vdpau: can't destroy output surface: %s\n"),
@@ -4450,6 +4456,12 @@ static void VdpauUpdateOutput(VdpauDecoder * decoder)
decoder->InputWidth * input_aspect_ratio.num,
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,
display_aspect_ratio.den);