diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-09-25 05:07:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-25 05:31:49 +0200 |
commit | 21922dc5aefa3b5a75420d6f444da6a14e352726 (patch) | |
tree | 7295d36787aaebe81f58fdcea4fd0556febd8a64 | |
parent | fc9d6035c3b19cc6be7f9706cbdbd5d9327bf297 (diff) | |
download | ffmpeg-21922dc5aefa3b5a75420d6f444da6a14e352726.tar.gz |
bit: replace assert() by proper check.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/bit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/bit.c b/libavformat/bit.c index 114d23dfc4..5fb3d552f3 100644 --- a/libavformat/bit.c +++ b/libavformat/bit.c @@ -72,7 +72,8 @@ static int read_packet(AVFormatContext *s, sync = get_le16(pb); // sync word packet_size = get_le16(pb) / 8; - assert(packet_size < 8 * MAX_FRAME_SIZE); + if(packet_size > MAX_FRAME_SIZE) + return AVERROR(EIO); ret = get_buffer(pb, (uint8_t*)buf, (8 * packet_size) * sizeof(uint16_t)); if(ret<0) |