Revert 130765 - alsa_output: Bounds check snd_pcm_avail_update.
Revert 130765 - alsa_output: Bounds check snd_pcm_avail_update.

Buggy ALSA drivers can at times return very large values from snd_pcm_avail_update.  There should never be more available frames than total frames in the buffer.

Patch by dgreid@chromium.org:
http://codereview.chromium.org/9963043/

BUG=chromium-os:26151
TEST=Manual, run a flash player looping alongside an aplay stress test and check that the flash video continues to output audio.

TBR=scherkus@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9996001

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@130773 0039d316-1c4b-4281-b951-d872f2087c98

crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,Just-D/chromium-1,dushu1203/chromium.src,hgl888/chromium-crosswalk,anirudhSK/chromium,littlstar/chromium.src,robclark/chromium,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,ChromiumWebApps/chromium,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,timopulkkinen/BubbleFish,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,ondra-novak/chromium.src,robclark/chromium,hgl888/chromium-crosswalk,bright-sparks/chromium-spacewalk,ChromiumWebApps/chromium,Chilledheart/chromium,Just-D/chromium-1,patrickm/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,keishi/chromium,Just-D/chromium-1,M4sse/chromium.src,hujiajie/pa-chromium,axinging/chromium-crosswalk,keishi/chromium,timopulkkinen/BubbleFish,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,axinging/chromium-crosswalk,markYoungH/chromium.src,keishi/chromium,dushu1203/chromium.src,anirudhSK/chromium,littlstar/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,timopulkkinen/BubbleFish,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,timopulkkinen/BubbleFish,hujiajie/pa-chromium,patrickm/chromium.src,patrickm/chromium.src,zcbenz/cefode-chromium,jaruba/chromium.src,Jonekee/chromium.src,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,mogoweb/chromium-crosswalk,M4sse/chromium.src,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,dednal/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,dushu1203/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,keishi/chromium,fujunwei/chromium-crosswalk,hujiajie/pa-chromium,jaruba/chromium.src,ChromiumWebApps/chromium,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,robclark/chromium,robclark/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,dednal/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,ltilve/chromium,dednal/chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,anirudhSK/chromium,hujiajie/pa-chromium,anirudhSK/chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,ondra-novak/chromium.src,keishi/chromium,nacl-webkit/chrome_deps,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,M4sse/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,hgl888/chromium-crosswalk,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,mogoweb/chromium-crosswalk,junmin-zhu/chromium-rivertrail,keishi/chromium,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,Just-D/chromium-1,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,ondra-novak/chromium.src,keishi/chromium,ondra-novak/chromium.src,mogoweb/chromium-crosswalk,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk-efl,ChromiumWebApps/chromium,littlstar/chromium.src,littlstar/chromium.src,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,chuan9/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk,littlstar/chromium.src,nacl-webkit/chrome_deps,markYoungH/chromium.src,robclark/chromium,krieger-od/nwjs_chromium.src,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,littlstar/chromium.src,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,keishi/chromium,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,hujiajie/pa-chromium,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,ltilve/chromium,TheTypoMaster/chromium-crosswalk,zcbenz/cefode-chromium,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,dushu1203/chromium.src,zcbenz/cefode-chromium,M4sse/chromium.src,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,zcbenz/cefode-chromium,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,Jonekee/chromium.src,ltilve/chromium,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,robclark/chromium,dednal/chromium.src,pozdnyakov/chromium-crosswalk,robclark/chromium,nacl-webkit/chrome_deps,Just-D/chromium-1,anirudhSK/chromium,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,hujiajie/pa-chromium,robclark/chromium,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,nacl-webkit/chrome_deps,anirudhSK/chromium,ltilve/chromium,nacl-webkit/chrome_deps,krieger-od/nwjs_chromium.src,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,littlstar/chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,hujiajie/pa-chromium,jaruba/chromium.src,ondra-novak/chromium.src,mohamed--abdel-maksoud/chromium.src,robclark/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,mogoweb/chromium-crosswalk,ondra-novak/chromium.src,junmin-zhu/chromium-rivertrail,ondra-novak/chromium.src,pozdnyakov/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,patrickm/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,axinging/chromium-crosswalk,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,pozdnyakov/chromium-crosswalk,hujiajie/pa-chromium,Jonekee/chromium.src,ltilve/chromium,dushu1203/chromium.src,patrickm/chromium.src,zcbenz/cefode-chromium,keishi/chromium,krieger-od/nwjs_chromium.src,nacl-webkit/chrome_deps,ChromiumWebApps/chromium,robclark/chromium,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,pozdnyakov/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,Fireblend/chromium-crosswalk,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,mohamed--abdel-maksoud/chromium.src,mogoweb/chromium-crosswalk,dednal/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,keishi/chromium,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,M4sse/chromium.src,ondra-novak/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,zcbenz/cefode-chromium,chuan9/chromium-crosswalk,zcbenz/cefode-chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,ltilve/chromium,markYoungH/chromium.src,Chilledheart/chromium,ltilve/chromium,timopulkkinen/BubbleFish,keishi/chromium,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,jaruba/chromium.src,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk