for (x = 0; x < width; x++)
p->temp[0][x + y * p->temp_stride[0]] += p->frame_dec->data[0][x + y * p->frame_dec->linesize[0] + offset];
+ if (!src[2] || !dst[2])
+ continue;
+
offset = (BLOCKc-x1c) + (BLOCKc-y1c) * p->frame_dec->linesize[1];
for (y = 0; y < height>>p->vsub; y++) {
int h = ((height + 4 * BLOCK-1) & (~(2 * BLOCK-1))) >> (is_chroma ? uspp->vsub : 0);
uspp->temp_stride[i] = w;
- if (!(uspp->temp[i] = av_malloc(uspp->temp_stride[i] * h * sizeof(int16_t))))
+ if (!(uspp->temp[i] = av_malloc_array(uspp->temp_stride[i], h * sizeof(int16_t))))
return AVERROR(ENOMEM);
- if (!(uspp->src [i] = av_malloc(uspp->temp_stride[i] * h * sizeof(uint8_t))))
+ if (!(uspp->src [i] = av_malloc_array(uspp->temp_stride[i], h * sizeof(uint8_t))))
return AVERROR(ENOMEM);
}