Module: Mesa
Branch: master
Commit: 05d302ffe2158b45d8ca7e625811fd2d9144b736
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=05d302ffe2158b45d8ca7e625811fd2d9144b736

Author: Leo Liu <leo....@amd.com>
Date:   Mon Jun 27 20:40:30 2016 -0400

st/omx: fix decoder fillout for the OMX result buffer

The call for vl_video_buffer_adjust_size is with wrong order of
arguments, apparently it will have problem when interlaced false;

The size of OMX result buffer depends on real size of clips, vl buffer
dimension is aligned with 16, so 1080p(1920*1080) video will overflow
the OMX buffer

Signed-off-by: Leo Liu <leo....@amd.com>
Reviewed-by: Christian König <christian.koe...@amd.com>
Tested-by: Julien Isorce <j.iso...@samsung.com>

---

 src/gallium/state_trackers/omx/vid_dec.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/omx/vid_dec.c 
b/src/gallium/state_trackers/omx/vid_dec.c
index 85ffb88..a989c10 100644
--- a/src/gallium/state_trackers/omx/vid_dec.c
+++ b/src/gallium/state_trackers/omx/vid_dec.c
@@ -523,9 +523,9 @@ static void vid_dec_FillOutput(vid_dec_PrivateType *priv, 
struct pipe_video_buff
 
    for (i = 0; i < 2 /* NV12 */; i++) {
       if (!views[i]) continue;
-      width = buf->width;
-      height = buf->height;
-      vl_video_buffer_adjust_size(&width, &height, i, buf->interlaced, 
buf->chroma_format);
+      width = def->nFrameWidth;
+      height = def->nFrameHeight;
+      vl_video_buffer_adjust_size(&width, &height, i, buf->chroma_format, 
buf->interlaced);
       for (j = 0; j < views[i]->texture->array_size; ++j) {
          struct pipe_box box = {0, 0, j, width, height, 1};
          struct pipe_transfer *transfer;
@@ -535,7 +535,8 @@ static void vid_dec_FillOutput(vid_dec_PrivateType *priv, 
struct pipe_video_buff
          if (!map)
             return;
 
-         dst = ((uint8_t*)output->pBuffer + output->nOffset) + j * 
def->nStride + i * buf->width * buf->height;
+         dst = ((uint8_t*)output->pBuffer + output->nOffset) + j * 
def->nStride +
+               i * def->nFrameWidth * def->nFrameHeight;
          util_copy_rect(dst,
             views[i]->texture->format,
             def->nStride * views[i]->texture->array_size, 0, 0,

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to