[FFmpeg-cvslog] avcodec/rpzaenc: fix assertions with very small width/height

Paul B Mahol git at videolan.org
Wed Sep 6 17:19:34 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Sep  6 15:35:55 2023 +0200| [6022e0b04f73841dc9bf9bce11a45e3c09e58e36] | committer: Paul B Mahol

avcodec/rpzaenc: fix assertions with very small width/height

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

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

diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c
index da9500e424..a399d55c93 100644
--- a/libavcodec/rpzaenc.c
+++ b/libavcodec/rpzaenc.c
@@ -802,7 +802,7 @@ static int rpza_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 {
     RpzaContext *s = avctx->priv_data;
     uint8_t *buf;
-    int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * avctx->height * avctx->width);
+    int ret = ff_alloc_packet(avctx, pkt, 4LL + 6LL * FFMAX(avctx->height, 4) * FFMAX(avctx->width, 4));
 
     if (ret < 0)
         return ret;



More information about the ffmpeg-cvslog mailing list