Browse Source

dpcm: return error if packet is too small

tags/n0.9
Justin Ruggles 13 years ago
parent
commit
08bd22a61b
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/dpcm.c

+ 4
- 1
libavcodec/dpcm.c View File

@@ -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);


Loading…
Cancel
Save