Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-03-20 02:12:01 +0300
committerMark Thompson <sw@jkqxz.net>2018-03-20 02:12:01 +0300
commit1c49365c62f417a9e7ed764ac4dd940a2ce8b08d (patch)
tree667f020128d7ee7f14ce5f96e4b7206aea1f8886 /libavcodec/h264_metadata_bsf.c
parente5b4cd4c4a9c98787b94ce33e268a61df9cf1587 (diff)
h264_metadata: Fix memory leak on multiple display orientation messages
Fixes CID #1430176.
Diffstat (limited to 'libavcodec/h264_metadata_bsf.c')
-rw-r--r--libavcodec/h264_metadata_bsf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/h264_metadata_bsf.c b/libavcodec/h264_metadata_bsf.c
index 3dc4affddd..e1f0c43b71 100644
--- a/libavcodec/h264_metadata_bsf.c
+++ b/libavcodec/h264_metadata_bsf.c
@@ -437,6 +437,10 @@ static int h264_metadata_filter(AVBSFContext *bsf, AVPacket *out)
180.0 / 65536.0);
av_display_matrix_flip(matrix, disp->hor_flip, disp->ver_flip);
+ // If there are multiple display orientation messages in an
+ // access unit then ignore all but the last one.
+ av_freep(&displaymatrix_side_data);
+
displaymatrix_side_data = (uint8_t*)matrix;
displaymatrix_side_data_size = 9 * sizeof(int32_t);
}