> >> - double duration_error[MAX_STREAMS][MAX_STD_TIMEBASES]={{0}}; //FIXME malloc()? > >> + double (*duration_error)[MAX_STD_TIMEBASES] = av_mallocz(MAX_STREAMS * MAX_STD_TIMEBASES * sizeof(duration_error)); > > > >Ahem, this, without any further pointer initialization, cannot > >possibly be correct, the first duration_error[i][j] dereference will > >crash, also I think the sizeof(duration_error) (== > >MAX_STD_TIME_BASES*sizeof(double*) in this case) is probably > >unintentionally large.. > > sizeof(duration_error) != MAX_STD_TIME_BASES*sizeof(double*) > sizeof(duration_error) == sizeof(double*) You're basically right here (discounting possible but improbable size difference between "pointer to array" and "pointer to first element"; I missed the indirection), but that is _even worse_ as usually sizeof(double*)<sizeof(double)! > Infact, it seems possibly correct ;] > http://c-faq.com/aryptr/dynmuldimary.html ..but then you would have to change the declaration to double (*duration_error)[MAX_STREAMS][MAX_STD_TIMEBASES] = ...; and _every single access_ to (*duration_error)[i][j] which your patch certainly didn't do. I stand by my claim that the patch is obviously incorrect. Regards, Wolfram.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4