[FFmpeg-devel] [PATCH 3/3] ffmdec: change type of len to ptrdiff_t

Michael Niedermayer michael at niedermayer.cc
Thu Jan 7 04:12:53 CET 2016


On Sat, Jan 02, 2016 at 04:52:25PM +0100, Andreas Cadhalpun wrote:
> It is used to store the difference between pointers, so ptrdiff_t is the
> correct type.
> 
> This prevents potential overflows.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/ffmdec.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

I think if these pointers can differ by more than te int range then
theres someting else wrong and changing one variable to ptrdiff_t
might be insufficient to support that

that said, it should do no harm if you feel that changing these 2
would make the code more robust

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160107/bbd0e4f6/attachment.sig>


More information about the ffmpeg-devel mailing list