Skip to content

Commit

Permalink
avcodec/exr: fix skipping too long metadata values
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpl committed Sep 22, 2022
1 parent c9aa616 commit f55f817
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libavcodec/exr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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);
}
Expand Down

0 comments on commit f55f817

Please sign in to comment.