diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 87e971d19c..77c0b24f39 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1485,7 +1485,8 @@ static int decode_block(AVCodecContext *avctx, void *tdata, } // Zero out the end if xmax+1 is not w - memset(ptr_x, 0, axmax); + if (s->desc->flags & AV_PIX_FMT_FLAG_PLANAR || !c) + memset(ptr_x, 0, axmax); channel_buffer[c] += td->channel_line_size; } }