From 86b521f7dfac8aa6a8edf030ce8fe987fb13a104 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 21 Nov 2014 09:59:58 +0100 Subject: Silence some Coverity warnings None of this really matters. --- common/encode_lavc.c | 1 + misc/bstr.c | 2 +- stream/stream_pvr.c | 1 + video/filter/vf_rotate.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/encode_lavc.c b/common/encode_lavc.c index 8877033f8d..92af771d61 100644 --- a/common/encode_lavc.c +++ b/common/encode_lavc.c @@ -1145,6 +1145,7 @@ void encode_lavc_fail(struct encode_lavc_context *ctx, const char *format, ...) va_list va; va_start(va, format); mp_msg_va(ctx->log, MSGL_ERR, format, va); + va_end(va); if (ctx->failed) return; ctx->failed = true; diff --git a/misc/bstr.c b/misc/bstr.c index 7db7015e1c..bb8446d254 100644 --- a/misc/bstr.c +++ b/misc/bstr.c @@ -277,7 +277,7 @@ int bstr_decode_utf8(struct bstr s, struct bstr *out_next) s.start++; s.len--; if (codepoint >= 128) { int bytes = bstr_parse_utf8_code_length(codepoint); - if (bytes < 0 || s.len < bytes - 1) + if (bytes < 1 || s.len < bytes - 1) return -1; codepoint &= 127 >> bytes; for (int n = 1; n < bytes; n++) { diff --git a/stream/stream_pvr.c b/stream/stream_pvr.c index 6fa0b93926..50a8ee5cba 100644 --- a/stream/stream_pvr.c +++ b/stream/stream_pvr.c @@ -1573,6 +1573,7 @@ pvr_stream_open (stream_t *stream) if (ioctl (pvr->dev_fd, VIDIOC_G_EXT_CTRLS, &ctrls) < 0) { MP_ERR(pvr, "%s device do not support MPEG input.\n", LOG_LEVEL_ENCODER); + pvr_uninit (pvr); return STREAM_ERROR; } diff --git a/video/filter/vf_rotate.c b/video/filter/vf_rotate.c index 579c3ea24a..9f0c60dd44 100644 --- a/video/filter/vf_rotate.c +++ b/video/filter/vf_rotate.c @@ -47,7 +47,7 @@ static int lavfi_reconfig(struct vf_instance *vf, struct vf_priv_s *p = vf_lw_old_priv(vf); if (p->angle == 4) { // "auto" int r = in->rotate; - if (r < 0 || (r % 90) != 0) { + if (r < 0 || r >= 360 || (r % 90) != 0) { MP_ERR(vf, "Can't apply rotation of %d degrees.\n", r); return -1; } -- cgit v1.2.3