From 5c2f9899dfe3e82becb8e04f419743a861a3749c Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Wed, 17 Jun 2026 15:11:25 +0800 Subject: [PATCH] avformat/matroskaenc: fix error code on LCEVC payload allocation failure The branch returned the ret variable when av_malloc() failed, but ret is uninitialized at that point unless an earlier branch happened to set it. --- libavformat/matroskaenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 7aa78754f3..97d66558f8 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -2995,7 +2995,7 @@ static int mkv_write_block(void *logctx, MatroskaMuxContext *mkv, lcevc = av_malloc(payload_size); if (!lcevc) - return ret; + return AVERROR(ENOMEM); AV_WB8 (lcevc + 0, ITU_T_T35_COUNTRY_CODE_UK); AV_WB8 (lcevc + 1, 0); // t35_uk_country_code_second_octet