mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avcodec/decode: always free private_ref
There is no reason to keep this intact when decoding failed, specially as private_ref is supposed to always be NULL when a frame is returned to the user.
This commit is contained in:
parent
6a4d1c9063
commit
8dd73f68a6
@ -613,7 +613,6 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
|
||||
if (ret == AVERROR_EOF)
|
||||
avci->draining_done = 1;
|
||||
|
||||
/* free the per-frame decode data */
|
||||
if (!ret) {
|
||||
/* the only case where decode data is not set should be decoders
|
||||
* that do not call ff_get_buffer() */
|
||||
@ -631,10 +630,11 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
av_buffer_unref(&frame->private_ref);
|
||||
}
|
||||
|
||||
/* free the per-frame decode data */
|
||||
av_buffer_unref(&frame->private_ref);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user