mirror of https://git.ffmpeg.org/ffmpeg.git
vorbisenc: Check the return value of av_frame_clone
Prevents a segfault when alloc fails. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
parent
37c57df18e
commit
e7af1394ec
|
@ -1093,9 +1093,13 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||||
PutBitContext pb;
|
PutBitContext pb;
|
||||||
|
|
||||||
if (frame) {
|
if (frame) {
|
||||||
|
AVFrame *clone;
|
||||||
if ((ret = ff_af_queue_add(&venc->afq, frame)) < 0)
|
if ((ret = ff_af_queue_add(&venc->afq, frame)) < 0)
|
||||||
return ret;
|
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
|
} else
|
||||||
if (!venc->afq.remaining_samples)
|
if (!venc->afq.remaining_samples)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue