]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/frame.c
Merge commit '3e8fd93b6ab219221e17fa2b6243cc72cf2d69dc'
[ffmpeg] / libavutil / frame.c
index 033f0134580a06a1f7626674564704192cedaf72..5607206a099d5f8f8cd863b99e302d00d0791405 100644 (file)
@@ -1,5 +1,4 @@
 /*
- *
  * This file is part of FFmpeg.
  *
  * FFmpeg is free software; you can redistribute it and/or
@@ -429,6 +428,14 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
         }
     }
 
+    if (src->hw_frames_ctx) {
+        dst->hw_frames_ctx = av_buffer_ref(src->hw_frames_ctx);
+        if (!dst->hw_frames_ctx) {
+            ret = AVERROR(ENOMEM);
+            goto fail;
+        }
+    }
+
     /* duplicate extended data */
     if (src->extended_data != src->data) {
         int ch = src->channels;
@@ -490,6 +497,8 @@ void av_frame_unref(AVFrame *frame)
     av_buffer_unref(&frame->qp_table_buf);
 #endif
 
+    av_buffer_unref(&frame->hw_frames_ctx);
+
     get_frame_defaults(frame);
 }