avformat/dhav: Check ffio_ensure_seekback()

Fixes Coverity issue #1492324.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
release/7.1
Andreas Rheinhardt 6 months ago
parent 95faf45af1
commit cf6d07522a
  1. 5
      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);

Loading…
Cancel
Save