aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mm.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-04-21 19:54:38 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-04-25 23:22:20 +0200
commit6dd83fab44ca309b02b4ca1baea3ca9ed8b6180f (patch)
tree16ef29576ca9cc40403644ed5ba185f1e9489c5d /libavformat/mm.c
parent122f86d8598715d47231de25385ae266504741f2 (diff)
downloadffmpeg-6dd83fab44ca309b02b4ca1baea3ca9ed8b6180f.tar.gz
avformat: Use ffio_read_size() where appropriate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/mm.c')
-rw-r--r--libavformat/mm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/mm.c b/libavformat/mm.c
index 13717b3254..4e69da0519 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -34,6 +34,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
+#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
@@ -144,8 +145,9 @@ static int read_packet(AVFormatContext *s,
if (avio_feof(pb))
return AVERROR_EOF;
- if (avio_read(pb, preamble, MM_PREAMBLE_SIZE) != MM_PREAMBLE_SIZE)
- return AVERROR(EIO);
+ ret = ffio_read_size(pb, preamble, MM_PREAMBLE_SIZE);
+ if (ret < 0)
+ return ret;
type = AV_RL16(&preamble[0]);
length = AV_RL16(&preamble[2]);
@@ -163,8 +165,9 @@ static int read_packet(AVFormatContext *s,
if ((ret = av_new_packet(pkt, length + MM_PREAMBLE_SIZE)) < 0)
return ret;
memcpy(pkt->data, preamble, MM_PREAMBLE_SIZE);
- if (avio_read(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length)
- return AVERROR(EIO);
+ ret = ffio_read_size(pb, pkt->data + MM_PREAMBLE_SIZE, length);
+ if (ret < 0)
+ return ret;
pkt->size = length + MM_PREAMBLE_SIZE;
pkt->stream_index = 0;
if (type!=MM_TYPE_PALETTE)