Commit e7af1394 authored by Derek Buitenhuis's avatar Derek Buitenhuis

vorbisenc: Check the return value of av_frame_clone

Prevents a segfault when alloc fails.
Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parent 37c57df1
......@@ -1093,9 +1093,13 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
PutBitContext pb;
if (frame) {
AVFrame *clone;
if ((ret = ff_af_queue_add(&venc->afq, frame)) < 0)
return ret;
ff_bufqueue_add(avctx, &venc->bufqueue, av_frame_clone(frame));
clone = av_frame_clone(frame);
if (!clone)
return AVERROR(ENOMEM);
ff_bufqueue_add(avctx, &venc->bufqueue, clone);
} else
if (!venc->afq.remaining_samples)
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment