diff options
author | James Almer <jamrial@gmail.com> | 2023-06-20 17:25:58 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-06-22 21:00:15 -0300 |
commit | 25ce1c8333337ca27cd0ca54da2179f122a0dc83 (patch) | |
tree | 6b55ac951b98270aa229b2a512b4d21d833f67b3 /libavformat | |
parent | 98346606015c309305587457f0197013df64872c (diff) | |
download | ffmpeg-25ce1c8333337ca27cd0ca54da2179f122a0dc83.tar.gz |
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>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/id3v2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index cb31864045..38c86a8e79 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -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; |