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>
This commit is contained in:
James Almer 2022-02-01 12:06:14 -03:00
parent c6fa5a8d04
commit 15a0ff81c5
1 changed files with 3 additions and 1 deletions

View File

@ -226,8 +226,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);