audio: st_rate_flow exist a dead loop
PATCH 1/1 audio: st_rate_flow exist a dead loop
From: Hao Peng <[email protected]>
if audio device is opend for a long time in windows vm, there is a uint32_t varaible reversal. It will result to a dead loop.
Signed-off-by Peng Hao <[email protected]>
Reviewed-by Liu Yun <[email protected]>
Reviewed-by Wang Yechao <[email protected]>
--- audio/rate_template.h | 5 +++++ 1 file changed, 5 insertions(+)
audio/rate_template.h +5 -0
@@ -71,6 +71,11 @@ void NAME (void *opaque, struct st_sample *ibuf, struct st_sample *obuf,while (rate->ipos <= (rate->opos >>32 )) { ilast = *ibuf++; rate->ipos++; +/* if ipos reversal, there is a dead loop */ +if (rate->ipos ==0xffffffff ) { + rate->ipos =1 ; + rate->opos = rate->opos &0xffffffff ; + }/* See if we finished the input buffer yet */ if (ibuf >= iend) { goto the_end;
Signature · 1 line
1.8.3.1