avcodec/libdav1d: free the Dav1dData packet on dav1d_send_data() failure

We still own it on failure, and there's no point trying to feed it again.

This should address the issue reported in dav1d #383 and part of VLC #26259.

Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
release/5.1
James Almer 3 years ago
parent d8d9d506a3
commit 61b104caaa
  1. 4
      libavcodec/libdav1d.c

@ -347,8 +347,10 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
if (res < 0) {
if (res == AVERROR(EINVAL))
res = AVERROR_INVALIDDATA;
if (res != AVERROR(EAGAIN))
if (res != AVERROR(EAGAIN)) {
dav1d_data_unref(data);
return res;
}
}
res = dav1d_get_picture(dav1d->c, p);

Loading…
Cancel
Save