MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / encode

Function encode

tools/target_enc_fuzzer.c:52–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51
52static int encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt)
53{
54 int ret;
55
56 ret = avcodec_send_frame(enc_ctx, frame);
57 if (ret < 0)
58 return ret;
59
60 while (ret >= 0) {
61 ret = avcodec_receive_packet(enc_ctx, pkt);
62 if (ret == AVERROR(EAGAIN)) {
63 return 0;
64 } else if (ret < 0) {
65 return ret;
66 }
67
68 av_packet_unref(pkt);
69 }
70 av_assert0(0);
71}
72
73int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
74 uint64_t maxpixels_per_frame = 512 * 512;

Callers 1

LLVMFuzzerTestOneInputFunction · 0.70

Calls 3

avcodec_send_frameFunction · 0.85
avcodec_receive_packetFunction · 0.85
av_packet_unrefFunction · 0.85

Tested by

no test coverage detected