Commit d976d2ec authored by Michael Niedermayer's avatar Michael Niedermayer

tools/target_dec_fuzzer: Fix build with default FFmpeg build flags

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent dfc4ce5f
...@@ -45,13 +45,17 @@ ...@@ -45,13 +45,17 @@
https://security.googleblog.com/2016/08/guided-in-process-fuzzing-of-chrome.html https://security.googleblog.com/2016/08/guided-in-process-fuzzing-of-chrome.html
*/ */
#include "config.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "libavformat/avformat.h" #include "libavformat/avformat.h"
#include <FuzzerInterface.h>
static void error(const char *err) static void error(const char *err)
{ {
fprintf(stderr, "%s", err); fprintf(stderr, "%s", err);
...@@ -96,16 +100,16 @@ typedef struct FuzzDataBuffer { ...@@ -96,16 +100,16 @@ typedef struct FuzzDataBuffer {
uint8_t *data_; uint8_t *data_;
} FuzzDataBuffer; } FuzzDataBuffer;
void FDBCreate(FuzzDataBuffer *FDB) { static void FDBCreate(FuzzDataBuffer *FDB) {
FDB->size_ = 0x1000; FDB->size_ = 0x1000;
FDB->data_ = av_malloc(FDB->size_); FDB->data_ = av_malloc(FDB->size_);
if (!FDB->data_) if (!FDB->data_)
error("Failed memory allocation"); error("Failed memory allocation");
} }
void FDBDesroy(FuzzDataBuffer *FDB) { av_free(FDB->data_); } static void FDBDesroy(FuzzDataBuffer *FDB) { av_free(FDB->data_); }
void FDBRealloc(FuzzDataBuffer *FDB, size_t size) { static void FDBRealloc(FuzzDataBuffer *FDB, size_t size) {
size_t needed = size + FF_INPUT_BUFFER_PADDING_SIZE; size_t needed = size + FF_INPUT_BUFFER_PADDING_SIZE;
av_assert0(needed > size); av_assert0(needed > size);
if (needed > FDB->size_) { if (needed > FDB->size_) {
...@@ -117,7 +121,7 @@ void FDBRealloc(FuzzDataBuffer *FDB, size_t size) { ...@@ -117,7 +121,7 @@ void FDBRealloc(FuzzDataBuffer *FDB, size_t size) {
} }
} }
void FDBPrepare(FuzzDataBuffer *FDB, AVPacket *dst, const uint8_t *data, static void FDBPrepare(FuzzDataBuffer *FDB, AVPacket *dst, const uint8_t *data,
size_t size) size_t size)
{ {
FDBRealloc(FDB, size); FDBRealloc(FDB, size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment