Browse Source

avcodec/pngenc: check return value of av_frame_copy()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n3.1
Paul B Mahol 10 years ago
parent
commit
1490682bcb
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      libavcodec/pngenc.c

+ 6
- 2
libavcodec/pngenc.c 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


Loading…
Cancel
Save