mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
IWYU: Include all headers for symbols used in files.
Semi-automatically taking the the misc-include-cleaner warnings by clang-tidy and fixing files to be self-contained. Change-Id: Iaaa2b2ec9d6dcce547fa5cb6b4f056dfc8c781ff
This commit is contained in:
@ -59,7 +59,7 @@ int AddFrame(WebPAnimEncoder** const enc,
|
||||
if (enc == nullptr || width == nullptr || height == nullptr) {
|
||||
fprintf(stderr, "NULL parameters.\n");
|
||||
if (enc != nullptr) WebPAnimEncoderDelete(*enc);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
// Init the source picture.
|
||||
@ -74,7 +74,7 @@ int AddFrame(WebPAnimEncoder** const enc,
|
||||
if (error_code == VP8_ENC_ERROR_OUT_OF_MEMORY) return 0;
|
||||
fprintf(stderr, "ExtractAndCropOrScale failed. Error code: %d\n",
|
||||
error_code);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
} else { // Other frames will be resized to the first frame's dimensions.
|
||||
if (!WebPPictureRescale(&pic, *width, *height)) {
|
||||
@ -85,7 +85,7 @@ int AddFrame(WebPAnimEncoder** const enc,
|
||||
fprintf(stderr,
|
||||
"WebPPictureRescale failed. Size: %d,%d. Error code: %d\n",
|
||||
*width, *height, error_code);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ int AddFrame(WebPAnimEncoder** const enc,
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr, "WebPEncode failed. Error code: %d\n", error_code);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
WebPPictureFree(&pic);
|
||||
@ -147,7 +147,7 @@ void AnimEncoderTest(std::string_view blob, bool minimize_size,
|
||||
WebPAnimEncoderOptions anim_config;
|
||||
if (!WebPAnimEncoderOptionsInit(&anim_config)) {
|
||||
fprintf(stderr, "WebPAnimEncoderOptionsInit failed.\n");
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
anim_config.minimize_size = minimize_size;
|
||||
anim_config.kmin = kmin_kmax.first;
|
||||
@ -170,7 +170,7 @@ void AnimEncoderTest(std::string_view blob, bool minimize_size,
|
||||
fprintf(stderr, "Last WebPAnimEncoderAdd failed: %s.\n",
|
||||
WebPAnimEncoderGetError(enc));
|
||||
WebPAnimEncoderDelete(enc);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
WebPData webp_data;
|
||||
WebPDataInit(&webp_data);
|
||||
@ -182,7 +182,7 @@ void AnimEncoderTest(std::string_view blob, bool minimize_size,
|
||||
WebPAnimEncoderGetError(enc));
|
||||
WebPAnimEncoderDelete(enc);
|
||||
WebPDataClear(&webp_data);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
WebPAnimEncoderDelete(enc);
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <string_view>
|
||||
|
||||
#include "src/webp/decode.h"
|
||||
@ -27,7 +28,7 @@ void DecodeWebP(std::string_view arbitrary_bytes) {
|
||||
WebPDecoderConfig decoder_config;
|
||||
if (!WebPInitDecoderConfig(&decoder_config)) {
|
||||
fprintf(stderr, "WebPInitDecoderConfig failed.\n");
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
const VP8StatusCode status =
|
||||
WebPDecode(reinterpret_cast<const uint8_t*>(arbitrary_bytes.data()),
|
||||
@ -36,7 +37,7 @@ void DecodeWebP(std::string_view arbitrary_bytes) {
|
||||
// The decoding may fail (because the fuzzed input can be anything) but not
|
||||
// for these reasons.
|
||||
if (status == VP8_STATUS_SUSPENDED || status == VP8_STATUS_USER_ABORT) {
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "./fuzz_utils.h"
|
||||
#include "src/dsp/cpu.h"
|
||||
@ -42,7 +43,7 @@ void EncDecTest(bool use_argb, int source_image_index, WebPConfig config,
|
||||
if (error_code == VP8_ENC_ERROR_OUT_OF_MEMORY) return;
|
||||
fprintf(stderr, "ExtractAndCropOrScale failed. Error code: %d\n",
|
||||
error_code);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
// Skip slow settings on big images, it's likely to timeout.
|
||||
@ -76,7 +77,7 @@ void EncDecTest(bool use_argb, int source_image_index, WebPConfig config,
|
||||
return;
|
||||
}
|
||||
fprintf(stderr, "WebPEncode failed. Error code: %d\n", error_code);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
// Try decoding the result.
|
||||
@ -87,7 +88,7 @@ void EncDecTest(bool use_argb, int source_image_index, WebPConfig config,
|
||||
fprintf(stderr, "WebPInitDecoderConfig failed.\n");
|
||||
WebPMemoryWriterClear(&memory_writer);
|
||||
WebPPictureFree(&pic);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
dec_config.output.colorspace = MODE_BGRA;
|
||||
@ -100,7 +101,7 @@ void EncDecTest(bool use_argb, int source_image_index, WebPConfig config,
|
||||
WebPFreeDecBuffer(&dec_config.output);
|
||||
WebPMemoryWriterClear(&memory_writer);
|
||||
WebPPictureFree(&pic);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
if (status == VP8_STATUS_OK) {
|
||||
@ -127,7 +128,7 @@ void EncDecTest(bool use_argb, int source_image_index, WebPConfig config,
|
||||
WebPFreeDecBuffer(&dec_config.output);
|
||||
WebPMemoryWriterClear(&memory_writer);
|
||||
WebPPictureFree(&pic);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
@ -41,7 +42,7 @@ void EncTest(std::string_view file, uint32_t optimization_index, bool use_argb,
|
||||
WebPPicture pic;
|
||||
if (!WebPPictureInit(&pic)) {
|
||||
std::cerr << "WebPPictureInit failed.\n";
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
pic.use_argb = use_argb;
|
||||
|
||||
@ -57,7 +58,7 @@ void EncTest(std::string_view file, uint32_t optimization_index, bool use_argb,
|
||||
WebPPictureFree(&pic);
|
||||
if (error_code == VP8_ENC_ERROR_OUT_OF_MEMORY) return;
|
||||
std::cerr << "CropOrScale failed. Error code: " << error_code << "\n";
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
// Skip the cruncher except on small images, it's likely to timeout.
|
||||
@ -78,7 +79,7 @@ void EncTest(std::string_view file, uint32_t optimization_index, bool use_argb,
|
||||
if (error_code == VP8_ENC_ERROR_OUT_OF_MEMORY) return;
|
||||
std::cerr << "WebPEncode failed. Error code: " << error_code
|
||||
<< " \nFile starts with: " << file.substr(0, 20) << "\n";
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
// Try decoding the result.
|
||||
@ -92,7 +93,7 @@ void EncTest(std::string_view file, uint32_t optimization_index, bool use_argb,
|
||||
WebPFree(rgba);
|
||||
WebPMemoryWriterClear(&memory_writer);
|
||||
WebPPictureFree(&pic);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
// Compare the results if exact encoding.
|
||||
@ -117,7 +118,7 @@ void EncTest(std::string_view file, uint32_t optimization_index, bool use_argb,
|
||||
WebPFree(rgba);
|
||||
WebPMemoryWriterClear(&memory_writer);
|
||||
WebPPictureFree(&pic);
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
@ -40,7 +38,7 @@ namespace fuzz_utils {
|
||||
|
||||
WebPPicture GetSourcePicture(int image_index, bool use_argb) {
|
||||
WebPPicture pic;
|
||||
if (!WebPPictureInit(&pic)) abort();
|
||||
if (!WebPPictureInit(&pic)) std::abort();
|
||||
pic.use_argb = use_argb;
|
||||
|
||||
// Pick a source picture.
|
||||
@ -52,7 +50,7 @@ WebPPicture GetSourcePicture(int image_index, bool use_argb) {
|
||||
pic.argb_stride = pic.width * 4 * sizeof(uint8_t);
|
||||
|
||||
// Read the bytes.
|
||||
if (!WebPPictureImportRGBA(&pic, image_data, pic.argb_stride)) abort();
|
||||
if (!WebPPictureImportRGBA(&pic, image_data, pic.argb_stride)) std::abort();
|
||||
return pic;
|
||||
}
|
||||
|
||||
|
@ -29,9 +29,10 @@
|
||||
#include "./img_alpha.h"
|
||||
#include "./img_grid.h"
|
||||
#include "./img_peak.h"
|
||||
#include "fuzztest/fuzztest.h"
|
||||
#include "src/dsp/cpu.h"
|
||||
#include "src/webp/encode.h"
|
||||
#include "fuzztest/fuzztest.h"
|
||||
#include "src/webp/types.h"
|
||||
|
||||
namespace fuzz_utils {
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <string_view>
|
||||
|
||||
#include "./fuzz_utils.h"
|
||||
|
@ -34,7 +34,7 @@ void TestReader(const uint8_t *data, size_t size, WebPImageReader reader,
|
||||
WebPPicture pic;
|
||||
if (!WebPPictureInit(&pic)) {
|
||||
std::cerr << "WebPPictureInit failed" << std::endl;
|
||||
abort();
|
||||
std::abort();
|
||||
}
|
||||
Metadata metadata;
|
||||
MetadataInit(&metadata);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "./fuzz_utils.h"
|
||||
#include "src/webp/demux.h"
|
||||
#include "src/webp/mux.h"
|
||||
#include "src/webp/mux_types.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -16,10 +16,12 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <string_view>
|
||||
|
||||
#include "./fuzz_utils.h"
|
||||
#include "src/webp/decode.h"
|
||||
#include "src/webp/types.h"
|
||||
|
||||
namespace {
|
||||
|
||||
|
Reference in New Issue
Block a user