mirror of
https://github.com/marqs85/ossc
synced 2026-11-04 06:07:22 +03:00
Guard clkcnt division against a zero line count
get_status() divides before check_linecnt() validates totlines; with no lines measured the divisor is zero (RISC-V returns all ones silently). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiXHy7Jhh5yTdsBaenucgw
This commit is contained in:
1 parent
5fd71e8312
commit
5ff096e9d4
1 file changed
+1
-1
@@ -369,7 +369,7 @@ status_t get_status(tvp_sync_input_t syncinput)
|
||||
pcnt_field = (unsigned long)sc->fe_status2.pcnt_field;
|
||||
hsync_width = (unsigned long)sc->fe_status2.hsync_width;
|
||||
|
||||
clkcnt = pcnt_field/(totlines>>!progressive);
|
||||
clkcnt = (totlines>>!progressive) ? pcnt_field/(totlines>>!progressive) : 0;
|
||||
valid_mode = (pcnt_field > 0) && check_linecnt(progressive, totlines);
|
||||
|
||||
// Check sync activity
|
||||
|
||||
Reference in new issue
Block a user