mpc7: return error if packet is too small.

This commit is contained in:
Justin Ruggles 2011-09-14 11:16:42 -04:00
parent c8b5c4d274
commit 8290d1f38b
1 changed files with 1 additions and 0 deletions

View File

@ -203,6 +203,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx,
memset(bands, 0, sizeof(bands)); memset(bands, 0, sizeof(bands));
if(buf_size <= 4){ if(buf_size <= 4){
av_log(avctx, AV_LOG_ERROR, "Too small buffer passed (%i bytes)\n", buf_size); av_log(avctx, AV_LOG_ERROR, "Too small buffer passed (%i bytes)\n", buf_size);
return AVERROR(EINVAL);
} }
out_size = (buf[1] ? c->lastframelen : MPC_FRAME_SIZE) * 4; out_size = (buf[1] ? c->lastframelen : MPC_FRAME_SIZE) * 4;