diff options
author | Michael Niedermayer | 2013-06-17 01:04:33 +0200 |
---|---|---|
committer | Michael Niedermayer | 2013-06-17 01:04:33 +0200 |
commit | 95275551ef280deadb73d04bad0472486e497115 (patch) | |
tree | 908ac496d72c0f95bb456053bf3a3e3ebf2b8b54 /libavformat/smacker.c | |
parent | e99f324c143a2d825b2be260cb6a799dbfe97a10 (diff) | |
parent | ee16a0ced01e6a33b7b01a0b21a0e07c1e1c7884 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
smacker: check frame size validity
Conflicts:
libavformat/smacker.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/smacker.c')
-rw-r--r-- | libavformat/smacker.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 7132a85565..b4c1bf4335 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -306,12 +306,14 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt) /* if audio chunks are present, put them to stack and retrieve later */ for(i = 0; i < 7; i++) { if(flags & 1) { - unsigned int size; + uint32_t size; uint8_t *tmpbuf; size = avio_rl32(s->pb) - 4; - if(size + 4L > frame_size) + if (!size || size + 4L > frame_size) { + av_log(s, AV_LOG_ERROR, "Invalid audio part size\n"); return AVERROR_INVALIDDATA; + } frame_size -= size; frame_size -= 4; smk->curstream++; |