aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-22 06:57:19 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-05-25 13:51:27 +0200
commitd8cad01805be74783344d69e81c9c31f49ba4d92 (patch)
tree31f6a67081a367badf05d5770de1932f3d98d151 /libavformat
parentcf6d07522a37ea9508468ffc43a0299f3e1c014c (diff)
downloadffmpeg-d8cad01805be74783344d69e81c9c31f49ba4d92.tar.gz
avformat/dhav: Check amount read
Prevents potential use of uninitialized data in the following memcmp(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dhav.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index 8e08274e68..b2ead99609 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -278,7 +278,9 @@ static int dhav_read_header(AVFormatContext *s)
if (ret < 0)
return ret;
- avio_read(s->pb, signature, sizeof(signature));
+ ret = ffio_read_size(s->pb, signature, sizeof(signature));
+ if (ret < 0)
+ return ret;
if (!memcmp(signature, "DAHUA", 5)) {
avio_skip(s->pb, 0x400 - 5);
dhav->last_good_pos = avio_tell(s->pb);