diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-02-18 23:03:37 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-02-25 21:20:11 +0100 |
commit | bc531eedbd2d31648602ae4112e2b09711f76fdf (patch) | |
tree | 72aa75be24bba33ae159fc429897bad851df842b | |
parent | e4eed311332fe329eef6bc8e9d7606a206c99469 (diff) | |
download | ffmpeg-bc531eedbd2d31648602ae4112e2b09711f76fdf.tar.gz |
avformat/wavarc: Check if extradata has been fully read
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2df271c78cd4b7d481a2d34abb71a2450b43c7e2)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/wavarc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/wavarc.c b/libavformat/wavarc.c index 208b723716..2b5d1b99eb 100644 --- a/libavformat/wavarc.c +++ b/libavformat/wavarc.c @@ -22,6 +22,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" +#include "avio_internal.h" #include "demux.h" #include "internal.h" @@ -84,7 +85,9 @@ static int wavarc_read_header(AVFormatContext *s) if (ret < 0) return ret; memcpy(par->extradata, data, sizeof(data)); - avio_read(pb, par->extradata + sizeof(data), fmt_len); + ret = ffio_read_size(pb, par->extradata + sizeof(data), fmt_len); + if (ret < 0) + return ret; par->codec_type = AVMEDIA_TYPE_AUDIO; par->codec_id = AV_CODEC_ID_WAVARC; |