diff options
author | Daniel Kang | 2011-01-11 14:08:45 +0000 |
---|---|---|
committer | Carl Eugen Hoyos | 2011-01-11 14:08:45 +0000 |
commit | e048a9cab10f1d41dca7b1ad9c8ecaceb3424d86 (patch) | |
tree | edfb2db5ca2ce9a187c621bcea1329205a4a6171 /libavcodec/pcm.c | |
parent | 440d761e40e05af4eed5fb8ceccbe50382c47465 (diff) |
Do not crash for illegal sample size, fixes issue 2502.
Patch by Daniel Kang, daniel.d.kang at gmail
Originally committed as revision 26309 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/pcm.c')
-rw-r--r-- | libavcodec/pcm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index b6b49dc049..533e834a54 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -292,6 +292,11 @@ static int pcm_decode_frame(AVCodecContext *avctx, /* we process 40-bit blocks per channel for LXF */ sample_size = 5; + if (sample_size == 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n"); + return AVERROR(EINVAL); + } + n = avctx->channels * sample_size; if(n && buf_size % n){ |