diff --git a/libavformat/fsb.c b/libavformat/fsb.c index 0febeffd56..1164f48b94 100644 --- a/libavformat/fsb.c +++ b/libavformat/fsb.c @@ -23,6 +23,7 @@ #include "libavutil/intreadwrite.h" #include "avformat.h" #include "avio.h" +#include "avio_internal.h" #include "demux.h" #include "internal.h" @@ -93,7 +94,9 @@ static int fsb_read_header(AVFormatContext *s) return ret; avio_seek(pb, 0x68, SEEK_SET); for (c = 0; c < par->ch_layout.nb_channels; c++) { - avio_read(pb, par->extradata + 32 * c, 32); + ret = ffio_read_size(pb, par->extradata + 32 * c, 32); + if (ret < 0) + return ret; avio_skip(pb, 14); } } else { @@ -146,7 +149,9 @@ static int fsb_read_header(AVFormatContext *s) return ret; avio_seek(pb, 0x80, SEEK_SET); for (c = 0; c < par->ch_layout.nb_channels; c++) { - avio_read(pb, par->extradata + 32 * c, 32); + ret = ffio_read_size(pb, par->extradata + 32 * c, 32); + if (ret < 0) + return ret; avio_skip(pb, 14); } par->block_align = 8 * par->ch_layout.nb_channels;