awdseq1357 / libyuv

Automatically exported from code.google.com/p/libyuv
0 stars 0 forks source link

Public API functions should all parameter check and return -1 for bad parameters #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some functions in convert and perhaps others, have an API with int return where 
0 is success and a non-zero is failure.
-1 should be returned if parameters are bad.  e.g. NULL pointer.
1 should be returned for other fatal errors, such as malloc failure.

The most common errors/bug reports for libyuv are caused by caller passing bad 
parameters.
The low level nature of the API has limitations on what can be checked, but 
most functions don't expect NULL pointers, width <= 0 or height == 0.
Note that stride can be 0 or negative.

Original issue reported on code.google.com by fbarch...@google.com on 11 Jul 2012 at 6:40

GoogleCodeExporter commented 9 years ago

Original comment by mikhal@google.com on 20 Jul 2012 at 7:22