avformat/mxfdec: Check size to avoid integer overflow in mxf_read_utf16_string()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/240/head
Michael Niedermayer 8 years ago
parent c495f4ffde
commit fecb3e82a4
  1. 2
      libavformat/mxfdec.c

@ -717,7 +717,7 @@ static inline int mxf_read_utf16_string(AVIOContext *pb, int size, char** str, i
int ret;
size_t buf_size;
if (size < 0)
if (size < 0 || size > INT_MAX/2)
return AVERROR(EINVAL);
buf_size = size + size / 2 + 1;

Loading…
Cancel
Save