1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

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:
Michael Niedermayer
2015-10-07 04:50:16 +02:00
parent e96ecaf053
commit a852db796e

View File

@@ -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);