1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/id3v2: check the return value of avio_close_dyn_buf()

Fixes ticket #10424.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2023-06-20 17:25:58 -03:00
parent 9834660601
commit 25ce1c8333

View File

@ -246,7 +246,7 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
int ret;
uint8_t tmp;
uint32_t ch = 1;
int left = *maxread;
int left = *maxread, dynsize;
unsigned int (*get)(AVIOContext*) = avio_rb16;
AVIOContext *dynbuf;
@ -308,7 +308,9 @@ static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
if (ch)
avio_w8(dynbuf, 0);
avio_close_dyn_buf(dynbuf, dst);
dynsize = avio_close_dyn_buf(dynbuf, dst);
if (dynsize <= 0)
return AVERROR(ENOMEM);
*maxread = left;
return 0;