avcodec/cbs_h264: Automatically free SEI payload on error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 11 Sep 2019 22:18:29 +0000 (00:18 +0200)
committerMark Thompson <sw@jkqxz.net>
Tue, 24 Sep 2019 14:54:31 +0000 (15:54 +0100)
commitf83ac5fd793f6464020777da6802803048b97fc6
tree3d4b4341e5b90653d7b29ab11afaea0c0da33f6d
parent8c7d5fcfc32d65951039ab2bb78947a41bdd96c4
avcodec/cbs_h264: Automatically free SEI payload on error

If adding an SEI message to an access unit fails, said SEI message was
not touched, so that the caller had to free any data associated with it
that might need to be freed. But given that ff_cbs_h264_add_sei_message
can simply call cbs_h264_free_sei_payload, one can easily free
the content of the SEI payload.

This fixes a memleak when inserting a user data unregistered string for
h264_metadata fails.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/cbs_h264.h
libavcodec/cbs_h2645.c