mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/vorbiscomment: Check entry length in ff_vorbiscomment_write()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eca38864a6
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
618c7a91ee
commit
27a0dab914
|
@ -61,8 +61,10 @@ int ff_vorbiscomment_write(uint8_t **p, AVDictionary **m,
|
||||||
AVDictionaryEntry *tag = NULL;
|
AVDictionaryEntry *tag = NULL;
|
||||||
bytestream_put_le32(p, count);
|
bytestream_put_le32(p, count);
|
||||||
while ((tag = av_dict_get(*m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
while ((tag = av_dict_get(*m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
||||||
unsigned int len1 = strlen(tag->key);
|
int64_t len1 = strlen(tag->key);
|
||||||
unsigned int len2 = strlen(tag->value);
|
int64_t len2 = strlen(tag->value);
|
||||||
|
if (len1+1+len2 > UINT32_MAX)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
bytestream_put_le32(p, len1+1+len2);
|
bytestream_put_le32(p, len1+1+len2);
|
||||||
bytestream_put_buffer(p, tag->key, len1);
|
bytestream_put_buffer(p, tag->key, len1);
|
||||||
bytestream_put_byte(p, '=');
|
bytestream_put_byte(p, '=');
|
||||||
|
|
Loading…
Reference in New Issue