Message ID | 20230620202658.10058-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | 25ce1c8333337ca27cd0ca54da2179f122a0dc83 |
Headers | show |
Series | [FFmpeg-devel] avformat/id3v2: check the return value of avio_close_dyn_buf() | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | fail | Make fate failed |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | fail | Make fate failed |
On Tue, Jun 20, 2023 at 05:26:58PM -0300, James Almer wrote: > Fixes ticket #10424. > > Signed-off-by: James Almer <jamrial@gmail.com> > --- > libavformat/id3v2.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) LGTM thx [...]
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;
Fixes ticket #10424. Signed-off-by: James Almer <jamrial@gmail.com> --- libavformat/id3v2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)