1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/pngenc: check return value of av_frame_copy()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2016-04-08 12:45:40 +02:00
parent c3320a51df
commit 1490682bcb

View File

@ -768,7 +768,9 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
diffFrame->width = pict->width;
diffFrame->height = pict->height;
av_frame_copy(diffFrame, s->last_frame);
ret = av_frame_copy(diffFrame, s->last_frame);
if (ret < 0)
goto fail;
if (last_fctl_chunk.dispose_op == APNG_DISPOSE_OP_BACKGROUND) {
for (y = last_fctl_chunk.y_offset; y < last_fctl_chunk.y_offset + last_fctl_chunk.height; ++y) {
@ -782,7 +784,9 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
diffFrame->width = pict->width;
diffFrame->height = pict->height;
av_frame_copy(diffFrame, s->prev_frame);
ret = av_frame_copy(diffFrame, s->prev_frame);
if (ret < 0)
goto fail;
}
// Do inverse blending