[FFmpeg-devel] [PATCH 2/3 v3] libopenmpt: add subsong support
Jörn Heusipp
osmanx at problemloesungsmaschine.de
Wed Jul 20 10:46:49 EEST 2016
On 07/19/2016 11:33 PM, Josh de Kock wrote:
> ---
> libavformat/libopenmpt.c | 26 +++++++++++++++++++++++---
> 1 file changed, 23 insertions(+), 3 deletions(-)
> + { "subsong", "set subsong", OFFSET(subsong), AV_OPT_TYPE_INT, { .i64 = -2 }, -2, INT_MAX, A | D, "layout"},
> + { "all", "all", 0, AV_OPT_TYPE_CONST, { .i64 = -1}, 0, 0, A | D, "layout" },
> + { "auto", "auto", 0, AV_OPT_TYPE_CONST, { .i64 = -2}, 0, 0, A | D, "layout" },
.unit = "layout"? Shouldn't this be called "subsong"?
> + if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) {
> + av_log(s, AV_LOG_ERROR, "Invalid subsong index: %d\n", openmpt->subsong);
> + return AVERROR(EINVAL);
> + }
Leaks openmpt->module in error path.
> + ret = openmpt_module_select_subsong(openmpt->module, openmpt->subsong);
> + if (!ret){
> + av_log(s, AV_LOG_ERROR, "Could not select requested subsong: %d", openmpt->subsong);
> + return AVERROR(EINVAL);
> + }
Leaks openmpt->module in error path.
Regards,
Jörn
More information about the ffmpeg-devel
mailing list