Skip to content

Dictionary ownership model seems error prone #1242

Description

@aconverse

Functions like int vmaf_model_feature_overload(VmafModel *model, const char *feature_name, VmafFeatureDictionary *opts_dict) sometimes free the passed in dictionary and sometimes doesn't. It doesn't seem to signal if the dictionary has been cleaned up or not to the caller other than by statically analyzing different error paths within the function.

This seems to be asking for memory-leaks, double-frees, and use-after-frees.

IMO it would make more sense for functions that might free dictionaries to accept a VmafDictionary** and null the inner pointer on free that same way vmaf_dictionary_free works.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions