Commit 1e7e4f13 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/pngdec: Check blend_op.

Fixes CID1322359, CID1322358
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent f3fc103c
...@@ -912,6 +912,11 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s, ...@@ -912,6 +912,11 @@ static int decode_fctl_chunk(AVCodecContext *avctx, PNGDecContext *s,
cur_w > s->width - x_offset|| cur_h > s->height - y_offset) cur_w > s->width - x_offset|| cur_h > s->height - y_offset)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (blend_op != APNG_BLEND_OP_OVER && blend_op != APNG_BLEND_OP_SOURCE) {
av_log(avctx, AV_LOG_ERROR, "Invalid blend_op %d\n", blend_op);
return AVERROR_INVALIDDATA;
}
if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS) { if (sequence_number == 0 && dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
// No previous frame to revert to for the first frame // No previous frame to revert to for the first frame
// Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND // Spec says to just treat it as a APNG_DISPOSE_OP_BACKGROUND
......
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