Silence some Coverity warnings

None of this really matters.
This commit is contained in:
wm4 2014-11-21 09:59:58 +01:00
parent e082c2c3df
commit 86b521f7df
4 changed files with 4 additions and 2 deletions

View File

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

View File

@ -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++) {

View File

@ -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;
}

View File

@ -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;
}