diff options
author | Oana Stratulat <oanaandreeastratulat@gmail.com> | 2012-01-04 03:13:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-04 02:39:49 +0100 |
commit | 0d3a51e5d279dd2a56c81ba7a81a70128c5a7545 (patch) | |
tree | 64edf6639b3e3787cf237c5dd1d83381ce874d96 /libavformat/electronicarts.c | |
parent | ad1c8dd6734f0aa7a7a87b4669a166715c114b46 (diff) | |
download | ffmpeg-0d3a51e5d279dd2a56c81ba7a81a70128c5a7545.tar.gz |
electronicarts: Fix division by zero. Fixes Ticket #793
Signed-off-by: Oana Stratulat <oanaandreeastratulat@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r-- | libavformat/electronicarts.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 75f92afc0f..41ed0891b9 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -221,6 +221,10 @@ static int process_audio_header_eacs(AVFormatContext *s) ea->sample_rate = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb); ea->bytes = avio_r8(pb); /* 1=8-bit, 2=16-bit */ + if(ea->bytes == 0){ + av_log(s,AV_LOG_ERROR,"the file is corrupted, ea->bytes = 0\n"); + return AVERROR_INVALIDDATA; + } ea->num_channels = avio_r8(pb); compression_type = avio_r8(pb); avio_skip(pb, 13); |