Commit 1490682b authored by Paul B Mahol's avatar Paul B Mahol

avcodec/pngenc: check return value of av_frame_copy()

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent c3320a51
...@@ -768,7 +768,9 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, ...@@ -768,7 +768,9 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) { if (last_fctl_chunk.dispose_op != APNG_DISPOSE_OP_PREVIOUS) {
diffFrame->width = pict->width; diffFrame->width = pict->width;
diffFrame->height = pict->height; 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) { 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) { 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, ...@@ -782,7 +784,9 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict,
diffFrame->width = pict->width; diffFrame->width = pict->width;
diffFrame->height = pict->height; 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 // Do inverse blending
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment