[FFmpeg-devel] [PATCH] Add FITS Demuxer

Nicolas George george at nsup.org
Sun Aug 6 14:57:58 EEST 2017

Le duodi 12 thermidor, an CCXXV, Paras Chadha a écrit :
> But i am returning the size from this function. If i make them unsigned,
> how will i return errors which are negative integers.
> One thing i can do is pass data_size as pointer to the function. Should i
> do that ?

No need: you can make the variables unsigned and still return them as
signed. The error codes never go into the variables.

> > Use the correct bound, long is wrong.
> okay, i was actually confused regarding the correct bound. So should i use
> INT_MAX as it is the default value max_alloc_size. Since i am adding 2879
> at the end, so correct limiting value would be INT_MAX - 2879. Am i correct
> or should i use something else ?

You have to use the constant that corresponds to the types in the
computation. If it is int, then INT_MAX, int64_t wants INT64_MAX and
size_t wants SIZE_MAX.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170806/28a4d6f7/attachment.sig>

More information about the ffmpeg-devel mailing list