From aa2274c1d296c91826633dd687327ecc3cf4d5a6 Mon Sep 17 00:00:00 2001 From: Christian König Date: Fri, 14 Mar 2014 13:59:19 +0100 Subject: st/omx/dec: fix possible segfault at eos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/gallium/state_trackers/omx/vid_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium/state_trackers') diff --git a/src/gallium/state_trackers/omx/vid_dec.c b/src/gallium/state_trackers/omx/vid_dec.c index e2a28913dde..de1c3825ebb 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; -- cgit v1.2.3