int dst_linesize[4];
int pix_fmt = AV_PIX_FMT_NONE;
heif_image_t *output;
+ int buffer_size = 0;
heif_retvm_if_failed(frame, LIBHEIF_ERROR_INVALID_PARAMETER, "invalid frame");
heif_retvm_if_failed(libav_output, LIBHEIF_ERROR_INVALID_PARAMETER, "invalid libav_output");
output = g_new0(heif_image_t, 1);
- output->size = (size_t)av_image_get_buffer_size(pix_fmt, frame->width, frame->height, 1);
- if (output->size <= 0) {
- heif_error("av_image_get_buffer_size fail [%d x %d]", frame->width, frame->height);
+ buffer_size = av_image_get_buffer_size(pix_fmt, frame->width, frame->height, 1);
+ if (buffer_size <= 0) {
+ heif_error("av_image_get_buffer_size fail %d [%d x %d]", buffer_size, frame->width, frame->height);
goto FAIL;
}
+ output->size = (size_t)buffer_size;
output->width = (unsigned int)frame->width;
output->height = (unsigned int)frame->height;
output->format = colr_fmt;