You've already forked FFmpeg
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:
@@ -842,6 +842,9 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
if (avctx->frame_number == 0) {
|
if (avctx->frame_number == 0) {
|
||||||
|
if (!pict)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
s->bytestream = avctx->extradata = av_malloc(FF_MIN_BUFFER_SIZE);
|
s->bytestream = avctx->extradata = av_malloc(FF_MIN_BUFFER_SIZE);
|
||||||
if (!avctx->extradata)
|
if (!avctx->extradata)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Reference in New Issue
Block a user