Commit f6e1c967 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

ffmdec: change type of len to ptrdiff_t

It is used to store the difference between pointers, so ptrdiff_t is the
correct type.

This prevents potential overflows.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 63c9b30f
......@@ -36,7 +36,7 @@ static int ffm_is_avail_data(AVFormatContext *s, int size)
{
FFMContext *ffm = s->priv_data;
int64_t pos, avail_size;
int len;
ptrdiff_t len;
len = ffm->packet_end - ffm->packet_ptr;
if (size <= len)
......@@ -87,8 +87,9 @@ static int ffm_read_data(AVFormatContext *s,
{
FFMContext *ffm = s->priv_data;
AVIOContext *pb = s->pb;
int len, fill_size, size1, frame_offset;
int fill_size, size1, frame_offset;
uint32_t id;
ptrdiff_t len;
int64_t last_pos = -1;
size1 = size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment