[FFmpeg-cvslog] avcodec/exr: fix skipping too long metadata values

Paul B Mahol git at videolan.org
Thu Sep 22 11:28:28 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Sep 22 10:28:36 2022 +0200| [f55f81795552d8f0a5d287973203bfce9cffe51e] | committer: Paul B Mahol

avcodec/exr: fix skipping too long metadata values

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

 libavcodec/exr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index e381e77e3f..f10754d6ae 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1962,7 +1962,7 @@ static int decode_header(EXRContext *s, AVFrame *frame)
         {
             uint8_t name[256] = { 0 };
             uint8_t type[256] = { 0 };
-            uint8_t value[256] = { 0 };
+            uint8_t value[8192] = { 0 };
             int i = 0, size;
 
             while (bytestream2_get_bytes_left(gb) > 0 &&
@@ -1980,6 +1980,8 @@ static int decode_header(EXRContext *s, AVFrame *frame)
             size = bytestream2_get_le32(gb);
 
             bytestream2_get_buffer(gb, value, FFMIN(sizeof(value) - 1, size));
+            if (size > sizeof(value) - 1)
+                bytestream2_skip(gb, size - (sizeof(value) - 1));
             if (!strcmp(type, "string"))
                 av_dict_set(&metadata, name, value, 0);
         }



More information about the ffmpeg-cvslog mailing list