Commit a852db79 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pngenc: Check that there is at least 1 frame

Fixes null pointer dereference
Fixes CID1322330
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent e96ecaf0
......@@ -842,6 +842,9 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
return AVERROR(ENOMEM);
if (avctx->frame_number == 0) {
if (!pict)
return AVERROR(EINVAL);
s->bytestream = avctx->extradata = av_malloc(FF_MIN_BUFFER_SIZE);
if (!avctx->extradata)
return AVERROR(ENOMEM);
......
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