JamesHeinrich / getID3

http://www.getid3.org/
Other
1.15k stars 245 forks source link

Guard against division by zero #404

Closed tstarling closed 1 year ago

tstarling commented 1 year ago

Motivation: https://phabricator.wikimedia.org/T289189

JamesHeinrich commented 1 year ago

Thanks for this contribution.

One thing I noticed, if you can fix before I merge it:

getid3/module.audio-video.ivf.php:48 it should be timebase_numerator/timebase_denominator but you have denominator twice

tstarling commented 1 year ago

getid3/module.audio-video.ivf.php:48 it should be timebase_numerator/timebase_denominator but you have denominator twice

Done. Sorry I missed this. I added SafeDiv after I was halfway through, so in this line I first added a ternary first and then incorrectly changed it to SafeDiv.