avcodec/bitpacked: check av_buffer_ref result

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
This commit is contained in:
Limin Wang 2021-10-02 22:23:19 +08:00
parent a742ba60f1
commit 617cf44c8c
1 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,10 @@ static int bitpacked_decode_uyvy422(AVCodecContext *avctx, AVFrame *frame,
/* there is no need to copy as the data already match
* a known pixel format */
frame->buf[0] = av_buffer_ref(avpkt->buf);
if (!frame->buf[0]) {
return AVERROR(ENOMEM);
}
ret = av_image_fill_arrays(frame->data, frame->linesize, avpkt->data,
avctx->pix_fmt, avctx->width, avctx->height, 1);
if (ret < 0) {