summaryrefslogtreecommitdiff
path: root/libavcodec/pngenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r--libavcodec/pngenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 0bae2acfb9..4204df2a30 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -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);