[Bf-blender-cvs] [a78d3c5261b] master: Fix: T91602 ffmpeg crash
Ray Molenkamp
noreply at git.blender.org
Thu Sep 23 01:29:29 CEST 2021
Commit: a78d3c5261b55ba2a63d550aafada518a0f88fbe
Author: Ray Molenkamp
Date: Wed Sep 22 17:29:23 2021 -0600
Branches: master
https://developer.blender.org/rBa78d3c5261b55ba2a63d550aafada518a0f88fbe
Fix: T91602 ffmpeg crash
Issue caused by our patch in rB1af722b81912
we replaced an array with a memory allocation
but we forgot to update the assert which now
used an invalid method to calculate the array
size.
SVN libs will have to be updated before
T91602 will be fixed for end users.
===================================================================
M build_files/build_environment/patches/ffmpeg.diff
===================================================================
diff --git a/build_files/build_environment/patches/ffmpeg.diff b/build_files/build_environment/patches/ffmpeg.diff
index 5a50a3f8756..c255f7c37a3 100644
--- a/build_files/build_environment/patches/ffmpeg.diff
+++ b/build_files/build_environment/patches/ffmpeg.diff
@@ -70,16 +70,18 @@
}
--- a/libavcodec/rl.c
+++ b/libavcodec/rl.c
-@@ -71,7 +71,7 @@ av_cold void ff_rl_init(RLTable *rl,
+@@ -71,17 +71,19 @@
av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
{
int i, q;
- VLC_TYPE table[1500][2] = {{0}};
+ VLC_TYPE (*table)[2] = av_calloc(sizeof(VLC_TYPE), 1500 * 2);
VLC vlc = { .table = table, .table_allocated = static_size };
- av_assert0(static_size <= FF_ARRAY_ELEMS(table));
+- av_assert0(static_size <= FF_ARRAY_ELEMS(table));
++ av_assert0(static_size < 1500);
init_vlc(&vlc, 9, rl->n + 1, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
-@@ -80,8 +80,10 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
+
+ for (q = 0; q < 32; q++) {
int qmul = q * 2;
int qadd = (q - 1) | 1;
@@ -91,7 +93,7 @@
if (q == 0) {
qmul = 1;
-@@ -113,4 +115,5 @@ av_cold void ff_rl_init_vlc(RLTable *rl, unsigned static_size)
+@@ -113,4 +115,5 @@
rl->rl_vlc[q][i].run = run;
}
}
More information about the Bf-blender-cvs
mailing list