[Mesa-dev] [PATCH] st/omx/dec: fix possible segfault at eos
Christian König
deathsimple at vodafone.de
Fri Mar 14 06:41:59 PDT 2014
From: Christian König <christian.koenig at amd.com>
Signed-off-by: Christian König <christian.koenig at amd.com>
---
src/gallium/state_trackers/omx/vid_dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/state_trackers/omx/vid_dec.c b/src/gallium/state_trackers/omx/vid_dec.c
index e2a2891..de1c3825 100644
--- a/src/gallium/state_trackers/omx/vid_dec.c
+++ b/src/gallium/state_trackers/omx/vid_dec.c
@@ -504,7 +504,7 @@ static OMX_ERRORTYPE vid_dec_DecodeBuffer(omx_base_PortType *port, OMX_BUFFERHEA
}
if (--priv->num_in_buffers) {
- unsigned delta = (min_bits_left - vl_vlc_bits_left(&vlc)) / 8;
+ unsigned delta = MIN2((min_bits_left - vl_vlc_bits_left(&vlc)) / 8, priv->sizes[1]);
priv->in_buffers[0] = priv->in_buffers[1];
priv->sizes[0] = priv->sizes[1] - delta;
--
1.8.3.2
More information about the mesa-dev
mailing list