Commit c16cd555 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '710b0e27'

* commit '710b0e27':
  smacker: Avoid integer overflow when allocating packets
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 33cf70a8 710b0e27
...@@ -331,7 +331,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -331,7 +331,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
} }
flags >>= 1; flags >>= 1;
} }
if (frame_size < 0) if (frame_size < 0 || frame_size >= INT_MAX/2)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (av_new_packet(pkt, frame_size + 769)) if (av_new_packet(pkt, frame_size + 769))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
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