aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-01-05 22:12:35 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-05-03 01:23:02 +0200
commite390a9de6f04eb081b66c8a81a88b17e08c5e605 (patch)
treef175e53c03ca14714e033135f8c20fc5f661e71d
parente70d202275bf93c6f0d480937a8230d45c343561 (diff)
downloadffmpeg-e390a9de6f04eb081b66c8a81a88b17e08c5e605.tar.gz
electronicarts: check bytes per sample for validity
Prevents division by zero.
-rw-r--r--libavformat/electronicarts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 43d1f26a8e..53041eee51 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -440,6 +440,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);