1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avformat: Use ffio_read_size() where appropriate

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-04-21 19:54:38 +02:00
parent 122f86d859
commit 6dd83fab44
14 changed files with 91 additions and 69 deletions

View File

@@ -566,9 +566,9 @@ redo:
static const unsigned char avs_seqh[4] = { 0, 0, 1, 0xb0 };
unsigned char buf[8];
ret = avio_read(s->pb, buf, 8);
if (ret != 8)
return AVERROR_INVALIDDATA;
ret = ffio_read_size(s->pb, buf, 8);
if (ret < 0)
return ret;
avio_seek(s->pb, -8, SEEK_CUR);
if (!memcmp(buf, avs_seqh, 4) && (buf[6] != 0 || buf[7] != 1))
codec_id = AV_CODEC_ID_CAVS;