mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/pngenc: Check that there is at least 1 frame
Fixes null pointer dereference Fixes CID1322330 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e96ecaf053
commit
a852db796e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue