summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-02 16:32:09 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-01-11 23:14:52 +0100
commitf6e1c96730ebbcebbd0341329d51d3d3a36b4fa1 (patch)
treeb78172d8ed925738c07ba7819a55a1a2fc4d1d13 /libavformat
parent63c9b30f98ce7d160b3a6dec1b36dc05fbb71941 (diff)
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: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/ffmdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index f754895986..41c518f3c7 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -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;