ffmpeg | branch: release/4.4 | Michael Niedermayer <mich...@niedermayer.cc> | 
Fri Jul 19 22:50:00 2024 +0200| [f6f253a47b5ff287644f5ae24a370743eba4750a] | 
committer: Michael Niedermayer

avcodec/cfhdenc: Allocate more space

Fixes: Assertion failure
Fixes: 
68979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5375874714107904

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit a308d79e4dedea11667cb2ad42c6676ce96e8ee1)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

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

diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c
index 42bbf99c96..5ef744c4c8 100644
--- a/libavcodec/cfhdenc.c
+++ b/libavcodec/cfhdenc.c
@@ -547,7 +547,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, 
AVPacket *pkt,
                          width, height * 2);
     }
 
-    ret = ff_alloc_packet2(avctx, pkt, 64LL + s->planes * (2LL * avctx->width 
* avctx->height + 1000LL), 0);
+    ret = ff_alloc_packet2(avctx, pkt, 256LL + s->planes * (4LL * avctx->width 
* (avctx->height + 15) + 2048LL), 0);
     if (ret < 0)
         return ret;
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to