avformat: Use ffio_read_size where appropriate

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2021-08-06 22:47:22 +02:00
parent dccd1d2a58
commit d1ac645636
8 changed files with 27 additions and 31 deletions

View File

@@ -3285,12 +3285,12 @@ int ff_get_extradata(AVFormatContext *s, AVCodecParameters *par, AVIOContext *pb
int ret = ff_alloc_extradata(par, size);
if (ret < 0)
return ret;
ret = avio_read(pb, par->extradata, size);
if (ret != size) {
ret = ffio_read_size(pb, par->extradata, size);
if (ret < 0) {
av_freep(&par->extradata);
par->extradata_size = 0;
av_log(s, AV_LOG_ERROR, "Failed to read extradata of size %d\n", size);
return ret < 0 ? ret : AVERROR_INVALIDDATA;
return ret;
}
return ret;