diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-01-06 01:12:35 +0400 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-01-07 03:18:42 +0400 |
commit | 73b16198b6cab1cdafa46143aae7a69e10e130fd (patch) | |
tree | e6c20b6d4c022c7f25afbe352823a7097c47d721 /libavformat/electronicarts.c | |
parent | b348c852aa8312d361123df0fa20e16feff7c2f1 (diff) |
electronicarts: check bytes per sample for validity
Prevents division by zero.
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r-- | libavformat/electronicarts.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 0facc8afba..01ba479fac 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -434,6 +434,11 @@ static int ea_read_header(AVFormatContext *s, ea->audio_codec = 0; return 1; } + if (ea->bytes <= 0) { + av_log(s, AV_LOG_ERROR, "Invalid number of bytes per sample: %d\n", ea->bytes); + ea->audio_codec = CODEC_ID_NONE; + return 1; + } /* initialize the audio decoder stream */ st = avformat_new_stream(s, NULL); |