# HG changeset patch # User jbr # Date 1189824268 0 # Node ID ed3e9456f29559611acaeb4f7660d7a6890b8643 # Parent 5ae5a74b0e4becc9090bd42632bd3ce62e68d837 skip incomplete frames diff -r 5ae5a74b0e4b -r ed3e9456f295 ac3dec.c --- a/ac3dec.c Sat Sep 15 02:41:24 2007 +0000 +++ b/ac3dec.c Sat Sep 15 02:44:28 2007 +0000 @@ -1120,6 +1120,12 @@ avctx->sample_rate = ctx->sampling_rate; avctx->bit_rate = ctx->bit_rate; + /* check that reported frame size fits in input buffer */ + if(ctx->frame_size > buf_size) { + av_log(avctx, AV_LOG_ERROR, "incomplete frame\n"); + return -1; + } + /* channel config */ ctx->out_channels = ctx->nchans; if (avctx->channels == 0) {