OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b348c85
)
electronicarts: check bytes per sample for validity
author
Janne Grunau
<janne-libav@jannau.net>
Thu, 5 Jan 2012 21:12:35 +0000
(22:12 +0100)
committer
Janne Grunau
<janne-libav@jannau.net>
Fri, 6 Jan 2012 23:18:42 +0000
(
00:18
+0100)
Prevents division by zero.
libavformat/electronicarts.c
patch
|
blob
|
history
diff --git
a/libavformat/electronicarts.c
b/libavformat/electronicarts.c
index
0facc8a
..
01ba479
100644
(file)
--- 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);