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