[FFmpeg-cvslog] avcodec/dovi_rpudec: don't unnecessarily allocate DOVIExt

Niklas Haas git at videolan.org
Fri Aug 16 12:52:13 EEST 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Sun Jul 14 15:33:27 2024 +0200| [1c4d4cc368bbaaf66b1f56a3af8b25409f35766c] | committer: Niklas Haas

avcodec/dovi_rpudec: don't unnecessarily allocate DOVIExt

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

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

diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c
index 6ef7a88ffd..3465665961 100644
--- a/libavcodec/dovi_rpudec.c
+++ b/libavcodec/dovi_rpudec.c
@@ -289,7 +289,7 @@ static int parse_ext_blocks(DOVIContext *s, GetBitContext *gb, int ver)
     num_ext_blocks = get_ue_golomb_31(gb);
     align_get_bits(gb);
 
-    if (!ext) {
+    if (num_ext_blocks && !ext) {
         ext = s->ext_blocks = ff_refstruct_allocz(sizeof(*s->ext_blocks));
         if (!ext)
             return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list