diff mbox series

[FFmpeg-devel,5/6] avformat/dhav: Check ffio_ensure_seekback()

Message ID GV1P250MB07374369ED3A054B64C318488FEB2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit cf6d07522a37ea9508468ffc43a0299f3e1c014c
Headers show
Series [FFmpeg-devel,1/6] avformat/oggdec: Check ffio_ensure_seekback() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Andreas Rheinhardt May 22, 2024, 5:08 a.m. UTC
Fixes Coverity issue #1492324.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/dhav.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

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);