aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-11 19:51:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-11 19:51:12 +0100
commit20769d9349ba598822334d666ef1f3e387df2dff (patch)
tree5c88be4ee942041ff1ef492622181972b0c336a4
parentbdab2421a540efc0593c87e6d247427a0a6e16bc (diff)
downloadffmpeg-20769d9349ba598822334d666ef1f3e387df2dff.tar.gz
avformat/electronicarts: check chunk size.
Fix infinite loop Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/electronicarts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 97c19c932a..3694a02176 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -361,6 +361,11 @@ static int process_ea_header(AVFormatContext *s)
if (ea->big_endian)
size = av_bswap32(size);
+ if (size < 8) {
+ av_log(s, AV_LOG_ERROR, "chunk size too small\n");
+ return AVERROR_INVALIDDATA;
+ }
+
switch (blockid) {
case ISNh_TAG:
if (avio_rl32(pb) != EACS_TAG) {