diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-09-11 13:18:51 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-09-30 18:15:53 -0400 |
commit | 08bd22a61b820160bff5f98cd51d2e0135d02e00 (patch) | |
tree | 4b7e0e42bda937ce8f2fc7c70443b634f3e84094 /libavcodec | |
parent | 0354fb7ebe177773e44b889ba7672e4336ee377f (diff) | |
download | ffmpeg-08bd22a61b820160bff5f98cd51d2e0135d02e00.tar.gz |
dpcm: return error if packet is too small
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dpcm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index d4cf806b82..6ba8ab13ce 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -201,7 +201,10 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, break; } out *= av_get_bytes_per_sample(avctx->sample_fmt); - + if (out < 0) { + av_log(avctx, AV_LOG_ERROR, "packet is too small\n"); + return AVERROR(EINVAL); + } if (*data_size < out) { av_log(avctx, AV_LOG_ERROR, "output buffer is too small\n"); return AVERROR(EINVAL); |