- c->slice_buffer = av_malloc(avctx->width * avctx->height +
- FF_INPUT_BUFFER_PADDING_SIZE);
-
- if (!c->slice_buffer) {
- av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 1.\n");
- utvideo_encode_close(avctx);
- return AVERROR(ENOMEM);
+ for (i = 0; i < c->planes; i++) {
+ c->slice_buffer[i] = av_malloc(c->slice_stride * (avctx->height + 2) +
+ FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!c->slice_buffer[i]) {
+ av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 1.\n");
+ utvideo_encode_close(avctx);
+ return AVERROR(ENOMEM);
+ }