This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/9.1 in repository ffmpeg.
commit 5cb8920e2a73cddd55a1bc301ec68e1fe62d4049 Author: Michael Niedermayer <[email protected]> AuthorDate: Thu Nov 5 23:59:22 2026 +0000 Commit: Michael Niedermayer <[email protected]> CommitDate: Sun Nov 15 06:17:20 2026 +0100 avcodec/diracdec: retain HQ scratch buffer on allocation failure Keep the existing scratch buffer and its published extents if resizing fails. Use av_realloc_array(), which leaves the old allocation intact, and commit the pointer and extents only after success. This allows decoding to retry the allocation on a later picture without using a null scratch buffer. Fixes: #24188 Assisted-by: Fairy (cherry picked from commit a0410859ec4a4361eb0835de508f7ec5e9313d2b) Signed-off-by: Michael Niedermayer <[email protected]> --- libavcodec/diracdec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index aa54dbaff2..719eeaaaf9 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -958,13 +958,15 @@ static int decode_lowdelay(DiracContext *s) if (s->threads_num_buf != avctx->thread_count || s->thread_buf_size != coef_buf_size) { - s->threads_num_buf = avctx->thread_count; - s->thread_buf_size = coef_buf_size; - s->thread_buf = av_realloc_f(s->thread_buf, avctx->thread_count, s->thread_buf_size); - if (!s->thread_buf) { + uint8_t *thread_buf = av_realloc_array(s->thread_buf, avctx->thread_count, + coef_buf_size); + if (!thread_buf) { av_log(s->avctx, AV_LOG_ERROR, "thread buffer allocation failure\n"); return AVERROR(ENOMEM); } + s->thread_buf = thread_buf; + s->threads_num_buf = avctx->thread_count; + s->thread_buf_size = coef_buf_size; } align_get_bits(&s->gb); -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
