aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-20 19:54:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-20 19:54:45 +0100
commit78e39aa7ee12bb61cf34d8ca6bebd129d659d9cd (patch)
tree7d3aed0445c3d2379842ea2a6dd39e3d3387ac3d /libavformat/avidec.c
parenteef74b2e97139d8422f76a0f8241aed17fc0617d (diff)
parentb7702fafb356b757dcd1b3d1ed4f2f32e4ebe9c1 (diff)
downloadffmpeg-78e39aa7ee12bb61cf34d8ca6bebd129d659d9cd.tar.gz
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: Avoid a possible overflow when reading Nikon avi files. Add h263dsp dependency to mpeg1video and mpeg2video encoders. Fix compilation with --disable-hwaccel=mpeg1_xvmc,mpeg2_xvmc Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 57fbcd7a1b..bab62a08c1 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -350,8 +350,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
uint16_t size = avio_rl16(s->pb);
const char *name = NULL;
char buffer[64] = { 0 };
- if (avio_tell(s->pb) + size > tag_end)
- size = tag_end - avio_tell(s->pb);
+ size = FFMIN(size, tag_end - avio_tell(s->pb));
size -= avio_read(s->pb, buffer,
FFMIN(size, sizeof(buffer) - 1));
switch (tag) {