diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index a1fbdb8a6e45a..5b08343603421 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -714,7 +714,7 @@ static void parse_trackvideo(struct demuxer *demuxer, struct mkv_track *track, } if (video->n_colour_space && video->colour_space.len == 4) { uint8_t *d = (uint8_t *)&video->colour_space.start[0]; - track->colorspace = d[0] | (d[1] << 8) | (d[2] << 16) | (d[3] << 24); + track->colorspace = d[0] | ((uint32_t)d[1] << 8) | ((uint32_t)d[2] << 16) | ((uint32_t)d[3] << 24); MP_DBG(demuxer, "| + Colorspace: %#"PRIx32"\n", track->colorspace); } if (video->n_stereo_mode) { diff --git a/options/m_option.c b/options/m_option.c index 0213ebf9128b0..6efa89a5c77c4 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2586,6 +2586,7 @@ static int parse_channels(struct mp_log *log, const m_option_t *opt, } if (dst) { + opt->type->free(dst); *(struct m_channels *)dst = res; } else { talloc_free(res.chmaps); diff --git a/sub/lavc_conv.c b/sub/lavc_conv.c index ead5ec2457d7d..eab8762df1141 100644 --- a/sub/lavc_conv.c +++ b/sub/lavc_conv.c @@ -107,7 +107,7 @@ struct lavc_conv *lavc_conv_create(struct sd *sd) error: MP_FATAL(priv, "Could not open libavcodec subtitle converter\n"); av_dict_free(&opts); - av_free(avctx); + avcodec_free_context(&avctx); mp_free_av_packet(&priv->avpkt); mp_free_av_packet(&priv->avpkt_vtt); talloc_free(priv);