The AV1 decoder has the FF_CODEC_CAP_INIT_CLEANUP flag set and yet
the decoder's close function is called manually on some error paths.
This is unnecessary and has been removed in this commit.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) {
s->ref[i].tf.f = av_frame_alloc();
if (!s->ref[i].tf.f) {
for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) {
s->ref[i].tf.f = av_frame_alloc();
if (!s->ref[i].tf.f) {
- av1_decode_free(avctx);
av_log(avctx, AV_LOG_ERROR,
"Failed to allocate reference frame buffer %d.\n", i);
return AVERROR(ENOMEM);
av_log(avctx, AV_LOG_ERROR,
"Failed to allocate reference frame buffer %d.\n", i);
return AVERROR(ENOMEM);
s->cur_frame.tf.f = av_frame_alloc();
if (!s->cur_frame.tf.f) {
s->cur_frame.tf.f = av_frame_alloc();
if (!s->cur_frame.tf.f) {
- av1_decode_free(avctx);
av_log(avctx, AV_LOG_ERROR,
"Failed to allocate current frame buffer.\n");
return AVERROR(ENOMEM);
av_log(avctx, AV_LOG_ERROR,
"Failed to allocate current frame buffer.\n");
return AVERROR(ENOMEM);
avctx->extradata_size);
if (ret < 0) {
av_log(avctx, AV_LOG_WARNING, "Failed to read extradata.\n");
avctx->extradata_size);
if (ret < 0) {
av_log(avctx, AV_LOG_WARNING, "Failed to read extradata.\n");
}
seq = ((CodedBitstreamAV1Context *)(s->cbc->priv_data))->sequence_header;
}
seq = ((CodedBitstreamAV1Context *)(s->cbc->priv_data))->sequence_header;