зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1656598 - Add AVIF support to DecodeToSurface fuzzer. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D85662
This commit is contained in:
Родитель
bc6cf9dde8
Коммит
0e309417bd
|
@ -10,6 +10,7 @@
|
||||||
#include "imgITools.h"
|
#include "imgITools.h"
|
||||||
#include "ImageOps.h"
|
#include "ImageOps.h"
|
||||||
#include "mozilla/gfx/2D.h"
|
#include "mozilla/gfx/2D.h"
|
||||||
|
#include "mozilla/Preferences.h"
|
||||||
#include "nsComponentManagerUtils.h"
|
#include "nsComponentManagerUtils.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsIInputStream.h"
|
#include "nsIInputStream.h"
|
||||||
|
@ -121,7 +122,13 @@ static int RunDecodeToSurfaceFuzzingWebP(nsCOMPtr<nsIInputStream> inputStream) {
|
||||||
return RunDecodeToSurfaceFuzzing(inputStream, "image/webp");
|
return RunDecodeToSurfaceFuzzing(inputStream, "image/webp");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int RunDecodeToSurfaceFuzzingAVIF(nsCOMPtr<nsIInputStream> inputStream) {
|
||||||
|
return RunDecodeToSurfaceFuzzing(inputStream, "image/avif");
|
||||||
|
}
|
||||||
|
|
||||||
int FuzzingInitImage(int* argc, char*** argv) {
|
int FuzzingInitImage(int* argc, char*** argv) {
|
||||||
|
Preferences::SetBool("image.avif.enabled", true);
|
||||||
|
|
||||||
nsCOMPtr<imgITools> imgTools =
|
nsCOMPtr<imgITools> imgTools =
|
||||||
do_CreateInstance("@mozilla.org/image/tools;1");
|
do_CreateInstance("@mozilla.org/image/tools;1");
|
||||||
if (imgTools == nullptr) {
|
if (imgTools == nullptr) {
|
||||||
|
@ -149,3 +156,6 @@ MOZ_FUZZING_INTERFACE_STREAM(FuzzingInitImage, RunDecodeToSurfaceFuzzingPNG,
|
||||||
|
|
||||||
MOZ_FUZZING_INTERFACE_STREAM(FuzzingInitImage, RunDecodeToSurfaceFuzzingWebP,
|
MOZ_FUZZING_INTERFACE_STREAM(FuzzingInitImage, RunDecodeToSurfaceFuzzingWebP,
|
||||||
ImageWebP);
|
ImageWebP);
|
||||||
|
|
||||||
|
MOZ_FUZZING_INTERFACE_STREAM(FuzzingInitImage, RunDecodeToSurfaceFuzzingAVIF,
|
||||||
|
ImageAVIF);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче