diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-09-12 00:18:29 +0200 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2019-09-24 15:54:31 +0100 |
commit | f83ac5fd793f6464020777da6802803048b97fc6 (patch) | |
tree | 3d4b4341e5b90653d7b29ab11afaea0c0da33f6d /libavcodec/cbs_h264.h | |
parent | 8c7d5fcfc32d65951039ab2bb78947a41bdd96c4 (diff) | |
download | ffmpeg-f83ac5fd793f6464020777da6802803048b97fc6.tar.gz |
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>
Diffstat (limited to 'libavcodec/cbs_h264.h')
-rw-r--r-- | libavcodec/cbs_h264.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/cbs_h264.h b/libavcodec/cbs_h264.h index b39e7480c9..9f7c2a0d30 100644 --- a/libavcodec/cbs_h264.h +++ b/libavcodec/cbs_h264.h @@ -468,10 +468,13 @@ typedef struct CodedBitstreamH264Context { /** * Add an SEI message to an access unit. + * + * On success, the payload will be owned by a unit in access_unit; + * on failure, the content of the payload will be freed. */ int ff_cbs_h264_add_sei_message(CodedBitstreamContext *ctx, CodedBitstreamFragment *access_unit, - const H264RawSEIPayload *payload); + H264RawSEIPayload *payload); /** * Delete an SEI message from an access unit. |