diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index d4cf806b82857410a47ca79d9348c8426a199774..6ba8ab13cef5c2778d987747c62ebb6fc4e29ddf 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);