Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2019-07-02 19:18:39 +0300
committerSybren A. Stüvel <sybren@blender.org>2019-07-02 19:20:52 +0300
commita5b7cf9b5f134febd726dc7a92e7602dc60862ad (patch)
tree7ac6dbf77f137a7700cf5c9d84a93405da18b4a4 /source/blender/blenkernel/intern/writeffmpeg.c
parent09ea5dfd096ea4e9c2ed5c4d4b1fb4e56d7b6713 (diff)
Fix T53058: Crash when rendering to Quicktime RLE codec
The root cause seems to be an assumption in [generate_video_frame()](https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/writeffmpeg.c) that we're always using 4 bytes per pixel. This is not true when using QTRLE in RGB mode, because that uses the RGB24 pixel format (so 3 bytes per pixel). Just updating the `linesize` property doesn't fix it though, but just creates a crash somewhere else. This at least fixes the crash by always forcing RGBA to be written, even when the user selects RGB.
Diffstat (limited to 'source/blender/blenkernel/intern/writeffmpeg.c')
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 681c03e25b6..f3336adda30 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -696,9 +696,9 @@ static AVStream *alloc_video_stream(FFMpegContext *context,
}
if (codec_id == AV_CODEC_ID_QTRLE) {
- if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
- c->pix_fmt = AV_PIX_FMT_ARGB;
- }
+ /* Always write to ARGB. The default pixel format of QTRLE is RGB24, which uses 3 bytes per
+ * pixels, which breaks the export. */
+ c->pix_fmt = AV_PIX_FMT_ARGB;
}
if (codec_id == AV_CODEC_ID_PNG) {