File ffmpeg-4-CVE-2024-12361.patch of Package ffmpeg-4
xxxxxxxxxx
1
From 4065ff69a2ed49872f8694a03d0642b18c9d977c Mon Sep 17 00:00:00 2001
2
From: Jiasheng Jiang <jiashengjiangcool@outlook.com>
3
Date: Mon, 10 Jun 2024 14:18:11 +0000
4
Subject: [PATCH] avcodec/mpegvideo_enc: Add check for
5
av_packet_new_side_data()
6
7
Add check for av_packet_new_side_data() to avoid null pointer
8
dereference if allocation fails.
9
10
Fixes: bdc1220eeb ("h263enc: Add an option for outputting info about MBs as side data")
11
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@outlook.com>
12
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13
---
14
libavcodec/mpegvideo_enc.c | 2 ++
15
1 file changed, 2 insertions(+)
16
17
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
18
index 620ca08869..d33754d115 100644
19
--- a/libavcodec/mpegvideo_enc.c
20
+++ b/libavcodec/mpegvideo_enc.c
21
22
s->mb_info_ptr = av_packet_new_side_data(pkt,
23
AV_PKT_DATA_H263_MB_INFO,
24
s->mb_width*s->mb_height*12);
25
+ if (!s->mb_info_ptr)
26
+ return AVERROR(ENOMEM);
27
s->prev_mb_info = s->last_mb_info = s->mb_info_size = 0;
28
}
29
30
--
31
2.44.0
32
33