diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-05-22 06:56:23 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-05-25 13:51:27 +0200 |
commit | cf6d07522a37ea9508468ffc43a0299f3e1c014c (patch) | |
tree | 42865d23a8ad8aed391170d839084c53ab74a94e | |
parent | 95faf45af16b15d55b3d9f8f3244d1437649d763 (diff) | |
download | ffmpeg-cf6d07522a37ea9508468ffc43a0299f3e1c014c.tar.gz |
avformat/dhav: Check ffio_ensure_seekback()
Fixes Coverity issue #1492324.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavformat/dhav.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/dhav.c b/libavformat/dhav.c index 303fb42bed..8e08274e68 100644 --- a/libavformat/dhav.c +++ b/libavformat/dhav.c @@ -273,8 +273,11 @@ static int dhav_read_header(AVFormatContext *s) { DHAVContext *dhav = s->priv_data; uint8_t signature[5]; + int ret = ffio_ensure_seekback(s->pb, 5); + + if (ret < 0) + return ret; - ffio_ensure_seekback(s->pb, 5); avio_read(s->pb, signature, sizeof(signature)); if (!memcmp(signature, "DAHUA", 5)) { avio_skip(s->pb, 0x400 - 5); |