summaryrefslogtreecommitdiff
path: root/libavcodec/bitpacked.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-10-02 22:23:19 +0800
committerLimin Wang <lance.lmwang@gmail.com>2021-10-11 23:27:08 +0800
commit617cf44c8c56066e87f80c85218add82f1714ae0 (patch)
tree0b04026db3ef9447200af25f14c336b416786da3 /libavcodec/bitpacked.c
parenta742ba60f14ee1265d01a5da59483ab7c2a6431c (diff)
avcodec/bitpacked: check av_buffer_ref result
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavcodec/bitpacked.c')
-rw-r--r--libavcodec/bitpacked.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/bitpacked.c b/libavcodec/bitpacked.c
index 8143151bc7..0440df9261 100644
--- a/libavcodec/bitpacked.c
+++ b/libavcodec/bitpacked.c
@@ -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) {