mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-10 00:30:14 +00:00
tools/target_dec_fuzzer: Do not use codec_id to look up decoder, but use selected decoder directly
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
4654baff12
commit
d58fe01774
@ -67,7 +67,6 @@ static AVCodec *AVCodecInitialize(enum AVCodecID codec_id)
|
|||||||
{
|
{
|
||||||
AVCodec *res;
|
AVCodec *res;
|
||||||
|
|
||||||
av_log_set_level(AV_LOG_PANIC);
|
|
||||||
res = avcodec_find_decoder(codec_id);
|
res = avcodec_find_decoder(codec_id);
|
||||||
if (!res)
|
if (!res)
|
||||||
error("Failed to find decoder");
|
error("Failed to find decoder");
|
||||||
@ -146,13 +145,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|||||||
#define DECODER_SYMBOL(CODEC) DECODER_SYMBOL0(CODEC)
|
#define DECODER_SYMBOL(CODEC) DECODER_SYMBOL0(CODEC)
|
||||||
extern AVCodec DECODER_SYMBOL(FFMPEG_DECODER);
|
extern AVCodec DECODER_SYMBOL(FFMPEG_DECODER);
|
||||||
avcodec_register(&DECODER_SYMBOL(FFMPEG_DECODER));
|
avcodec_register(&DECODER_SYMBOL(FFMPEG_DECODER));
|
||||||
int codec_id = DECODER_SYMBOL(FFMPEG_DECODER).id;
|
|
||||||
|
|
||||||
c = AVCodecInitialize(codec_id); // Done once.
|
c = &DECODER_SYMBOL(FFMPEG_DECODER);
|
||||||
#else
|
#else
|
||||||
avcodec_register_all();
|
avcodec_register_all();
|
||||||
c = AVCodecInitialize(FFMPEG_CODEC); // Done once.
|
c = AVCodecInitialize(FFMPEG_CODEC); // Done once.
|
||||||
#endif
|
#endif
|
||||||
|
av_log_set_level(AV_LOG_PANIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (c->type) {
|
switch (c->type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user