summaryrefslogtreecommitdiffstats
path: root/audio/aframe.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/aframe.c')
-rw-r--r--audio/aframe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/audio/aframe.c b/audio/aframe.c
index 118962f35b..655a4a38c3 100644
--- a/audio/aframe.c
+++ b/audio/aframe.c
@@ -598,7 +598,11 @@ int mp_aframe_pool_allocate(struct mp_aframe_pool *pool, struct mp_aframe *frame
{
int planes = mp_aframe_get_planes(frame);
size_t sstride = mp_aframe_get_sstride(frame);
- int plane_size = MP_ALIGN_UP(sstride * MPMAX(samples, 1), 32);
+ // FFmpeg hardcodes similar hidden possibly-requirements in a number of
+ // places: av_frame_get_buffer(), libavcodec's get_buffer(), mem.c,
+ // probably more.
+ int align_samples = MP_ALIGN_UP(MPMAX(samples, 1), 32);
+ int plane_size = MP_ALIGN_UP(sstride * align_samples, 64);
int size = plane_size * planes;
if (size <= 0 || mp_aframe_is_allocated(frame))