| 76 | } |
| 77 | |
| 78 | static int wrapped_avframe_decode(AVCodecContext *avctx, AVFrame *out, |
| 79 | int *got_frame, AVPacket *pkt) |
| 80 | { |
| 81 | AVFrame *in; |
| 82 | int err; |
| 83 | |
| 84 | if (!(pkt->flags & AV_PKT_FLAG_TRUSTED)) { |
| 85 | // This decoder is not usable with untrusted input. |
| 86 | return AVERROR(EPERM); |
| 87 | } |
| 88 | |
| 89 | if (pkt->size < sizeof(AVFrame)) |
| 90 | return AVERROR(EINVAL); |
| 91 | |
| 92 | in = (AVFrame*)pkt->data; |
| 93 | |
| 94 | err = av_frame_ref(out, in); |
| 95 | if (err < 0) |
| 96 | return err; |
| 97 | |
| 98 | err = ff_decode_frame_props(avctx, out); |
| 99 | if (err < 0) |
| 100 | return err; |
| 101 | |
| 102 | *got_frame = 1; |
| 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | const FFCodec ff_wrapped_avframe_encoder = { |
| 107 | .p.name = "wrapped_avframe", |
nothing calls this directly
no test coverage detected