﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
13531	Fix for Coverity 1456162 and 1456180	Gary Buhrmaster	David Hampton	"Low hanging fruit from Coverity scan.

Sizeof returns size of the array (24 for a 3 array double on some architectures) and not the number of elements.

Compile tested only.


{{{
diff --git a/mythtv/libs/libmythui/DisplayResScreen.cpp b/mythtv/libs/libmythui/DisplayResScreen.cpp
index 44ffc8c015..a94fd319c5 100644
--- a/mythtv/libs/libmythui/DisplayResScreen.cpp
+++ b/mythtv/libs/libmythui/DisplayResScreen.cpp
@@ -140,7 +140,7 @@ int DisplayResScreen::FindBestMatch(const DisplayResVector& dsr,
                 while (!end)
                 {
                     double precisions1[] = {0.001, 0.01, 0.1};
-                    for (uint p = 0; p < sizeof(precisions1); p++)
+                    for (uint p = 0; p < (sizeof(precisions1)/sizeof(precisions1[0])); p++)
                     {
                         double precision = precisions1[p];
                         for (size_t j=0; j < rates.size(); ++j)
@@ -159,7 +159,7 @@ int DisplayResScreen::FindBestMatch(const DisplayResVector& dsr,
                     // Can't find exact frame rate, so try rounding to the
                     // nearest integer, so 23.97Hz will work with 24Hz etc
                     double precisions2[] = {0.01, 0.1, 1};
-                    for (uint p = 0; p < sizeof(precisions2); p++)
+                    for (uint p = 0; p < (sizeof(precisions2)/sizeof(precisions2[0])); p++)
                     {
                         double precision = precisions2[p];
                         double rounded = round(videorate);
}}}"	Patch - Bug Fix	closed	minor	31.0	MythTV - General	Master Head	medium	fixed			0
