[FFmpeg-cvslog] avcodec/hdrenc: Allocate more space

Michael Niedermayer git at videolan.org
Wed Jul 24 00:24:34 EEST 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Jul 19 23:45:27 2024 +0200| [204f7f8cc73109d14c3f76b7b57f6b36fe041ee8] | committer: Michael Niedermayer

avcodec/hdrenc: Allocate more space

This needs to be double checked or a checking way of writing should be used

Fixes: out of array access
Fixes: 70007/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HDR_fuzzer-5478704150020096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=204f7f8cc73109d14c3f76b7b57f6b36fe041ee8
---

 libavcodec/hdrenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hdrenc.c b/libavcodec/hdrenc.c
index 20e42134bc..a7bf36946d 100644
--- a/libavcodec/hdrenc.c
+++ b/libavcodec/hdrenc.c
@@ -124,7 +124,7 @@ static int hdr_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     uint8_t *buf;
     int ret;
 
-    packet_size = avctx->width * avctx->height * 4LL + 1024LL;
+    packet_size = avctx->height * 4LL + avctx->width * avctx->height * 8LL + 1024LL;
     if ((ret = ff_get_encode_buffer(avctx, pkt, packet_size, 0)) < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list