diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-06-26 15:18:56 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-06-26 15:20:43 +0200 |
commit | 2c1d0f871f6a3ee851f7094cc9946652ba1788ab (patch) | |
tree | 3ed831536315722b714b936450eb5ab63095ab2e /libavcodec | |
parent | b20fe650ef856006b50bbd767a39e19a8a6319f8 (diff) | |
parent | 24b5cff01bbac4e08acfd6d19c499e880988f520 (diff) | |
download | ffmpeg-2c1d0f871f6a3ee851f7094cc9946652ba1788ab.tar.gz |
Merge commit '24b5cff01bbac4e08acfd6d19c499e880988f520'
* commit '24b5cff01bbac4e08acfd6d19c499e880988f520':
lavc: handle hw_frames_ctx where necessary
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/options.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c index 10dc0558c6..d8e3dbfa33 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -233,6 +233,7 @@ FF_ENABLE_DEPRECATION_WARNINGS dest->inter_matrix = NULL; dest->rc_override = NULL; dest->subtitle_header = NULL; + dest->hw_frames_ctx = NULL; #define alloc_and_copy_or_fail(obj, size, pad) \ if (src->obj && size > 0) { \ @@ -253,14 +254,21 @@ FF_ENABLE_DEPRECATION_WARNINGS av_assert0(dest->subtitle_header_size == src->subtitle_header_size); #undef alloc_and_copy_or_fail + if (src->hw_frames_ctx) { + dest->hw_frames_ctx = av_buffer_ref(src->hw_frames_ctx); + if (!dest->hw_frames_ctx) + goto fail; + } + return 0; fail: + av_freep(&dest->subtitle_header); av_freep(&dest->rc_override); av_freep(&dest->intra_matrix); av_freep(&dest->inter_matrix); av_freep(&dest->extradata); - av_freep(&dest->subtitle_header); + av_buffer_unref(&dest->hw_frames_ctx); dest->subtitle_header_size = 0; dest->extradata_size = 0; av_opt_free(dest); |