GNOME Bugzilla – Bug 785696
io-gif: Switch arguments to fread() to fix Coverity issue
Last modified: 2017-08-15 09:15:18 UTC
Trivial patch attached. Hopefully that will fix the Coverity issue (#1452089).
Created attachment 356740 [details] [review] io-gif: Switch arguments to fread() to fix Coverity issue The arguments were provided the wrong way round: the variable number should always be the nmemb argument, rather than loading a single element of variable size. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Review of attachment 356740 [details] [review]: FWIW, patch LGTM.
Review of attachment 356740 [details] [review]: Does this make any difference in terms of performance, or do the 2 different options behave exactly the same? If the latter, then please push to master.
Performance seems to be the same, according to SO: https://stackoverflow.com/questions/8589425/how-does-fread-really-work#answer-8589797. I haven’t profiled. Pushed to master with one additional fix to update the error handling for the new potential return values (which are now 0..len rather than 0..1). Attachment 356740 [details] pushed as 82664fe - io-gif: Switch arguments to fread() to fix Coverity issue