comparison libmpcodecs/ad_hwmpa.c @ 30690:d3bdd149294e

Fix check for wrong variable: len can be unitialized but not normally < 0, the return value needs to be checked to detect an error.
author reimar
date Thu, 25 Feb 2010 22:06:05 +0000
parents cc27da5d7286
children
comparison
equal deleted inserted replaced
30689:ebe42a93c6c3 30690:d3bdd149294e
149 return CONTROL_TRUE; 149 return CONTROL_TRUE;
150 else 150 else
151 return CONTROL_FALSE; 151 return CONTROL_FALSE;
152 case ADCTRL_SKIP_FRAME: 152 case ADCTRL_SKIP_FRAME:
153 start = mpa_sync(sh, 2, &len, NULL, NULL, NULL, NULL, NULL); 153 start = mpa_sync(sh, 2, &len, NULL, NULL, NULL, NULL, NULL);
154 if(len < 0) 154 if(start < 0)
155 return CONTROL_FALSE; 155 return CONTROL_FALSE;
156 156
157 sh->a_in_buffer_len -= start; 157 sh->a_in_buffer_len -= start;
158 memmove(sh->a_in_buffer, &(sh->a_in_buffer[start]), sh->a_in_buffer_len); 158 memmove(sh->a_in_buffer, &(sh->a_in_buffer[start]), sh->a_in_buffer_len);
159 return CONTROL_TRUE; 159 return CONTROL_TRUE;