[FFmpeg-cvslog] Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972'

Hendrik Leppkes git at videolan.org
Sun Nov 13 23:37:18 EET 2016


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Sun Nov 13 22:36:18 2016 +0100| [3aa7b0a27326bd312ef790d9149f6b5efff97311] | committer: Hendrik Leppkes

Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972'

* commit 'f62bb216ac4cfbbff16108c6bac35a0282532972':
  hwcontext_vaapi: allow transfers to/from any size of sw frame

Merged-by: Hendrik Leppkes <h.leppkes at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3aa7b0a27326bd312ef790d9149f6b5efff97311
---

 libavutil/hwcontext_vaapi.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 605e465..6176bdc 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -817,6 +817,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
     AVFrame *map;
     int err;
 
+    if (dst->width > hwfc->width || dst->height > hwfc->height)
+        return AVERROR(EINVAL);
+
     map = av_frame_alloc();
     if (!map)
         return AVERROR(ENOMEM);
@@ -826,6 +829,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
     if (err)
         goto fail;
 
+    map->width  = dst->width;
+    map->height = dst->height;
+
     err = av_frame_copy(dst, map);
     if (err)
         goto fail;
@@ -842,6 +848,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
     AVFrame *map;
     int err;
 
+    if (src->width > hwfc->width || src->height > hwfc->height)
+        return AVERROR(EINVAL);
+
     map = av_frame_alloc();
     if (!map)
         return AVERROR(ENOMEM);
@@ -851,6 +860,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
     if (err)
         goto fail;
 
+    map->width  = src->width;
+    map->height = src->height;
+
     err = av_frame_copy(map, src);
     if (err)
         goto fail;


======================================================================




More information about the ffmpeg-cvslog mailing list