mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 1086596 - Fix potential crash if get camera boolean parameter is misused. r=mikeh
This commit is contained in:
parent
cee822c738
commit
341f434a1e
@ -352,7 +352,7 @@ GonkCameraParameters::SetTranslated(uint32_t aKey, const ICameraControl::Size& a
|
||||
if (aSize.width > INT_MAX || aSize.height > INT_MAX) {
|
||||
// AOSP can only handle signed ints.
|
||||
DOM_CAMERA_LOGE("Camera parameter aKey=%d out of bounds (width=%u, height=%u)\n",
|
||||
aSize.width, aSize.height);
|
||||
aKey, aSize.width, aSize.height);
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,13 @@ protected:
|
||||
void get(const char* aKey, double& aRet) { aRet = getFloat(aKey); }
|
||||
void get(const char* aKey, const char*& aRet) { aRet = get(aKey); }
|
||||
void get(const char* aKey, int& aRet) { aRet = getInt(aKey); }
|
||||
void get(const char* aKey, bool& aRet) { aRet = strcmp(get(aKey), FALSE); }
|
||||
|
||||
void
|
||||
get(const char* aKey, bool& aRet)
|
||||
{
|
||||
const char* value = get(aKey);
|
||||
aRet = value ? strcmp(value, TRUE) == 0 : false;
|
||||
}
|
||||
|
||||
void remove(const char* aKey) { android::CameraParameters::remove(aKey); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user