_stride[0] = _stride[1] = _stride[2] = _stride[3] = 0;
for (int i = 0; i < components(); ++i) {
- _line_size[i] = _size.width * bytes_per_pixel(i);
+ _line_size[i] = ceil (_size.width * bytes_per_pixel(i));
_stride[i] = stride_round_up (i, _line_size, _aligned ? 32 : 1);
_data[i] = (uint8_t *) av_malloc (_stride[i] * lines (i));
}
if (content->trimmed (relative_time)) {
return;
}
-
- shared_ptr<Image> work_image = image->crop (content->crop(), true);
+
+ /* Convert to RGB first, as FFmpeg doesn't seem to like handling YUV images with odd widths */
+ shared_ptr<Image> work_image = image->scale (image->size (), _film->scaler(), PIX_FMT_RGB24, true);
+
+ shared_ptr<Image> work_image = work_image->crop (content->crop(), true);
libdcp::Size const image_size = content->ratio()->size (_video_container_size);