Mercurial > libavcodec.hg
changeset 1809:45a7f6690782 libavcodec
more error checks for the sequence header
author | michael |
---|---|
date | Mon, 16 Feb 2004 03:34:11 +0000 |
parents | 9d860b33fd54 |
children | fc6b38b5dd40 |
files | mpeg12.c |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mpeg12.c Sat Feb 14 18:12:36 2004 +0000 +++ b/mpeg12.c Mon Feb 16 03:34:11 2004 +0000 @@ -2373,6 +2373,10 @@ if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); + if(v==0){ + av_log(s->avctx, AV_LOG_ERROR, "intra matrix damaged\n"); + return -1; + } j = s->intra_scantable.permutated[i]; s->intra_matrix[j] = v; s->chroma_intra_matrix[j] = v; @@ -2394,6 +2398,10 @@ if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); + if(v==0){ + av_log(s->avctx, AV_LOG_ERROR, "inter matrix damaged\n"); + return -1; + } j = s->intra_scantable.permutated[i]; s->inter_matrix[j] = v; s->chroma_inter_matrix[j] = v; @@ -2412,6 +2420,11 @@ s->chroma_inter_matrix[j] = v; } } + + if(show_bits(&s->gb, 23) != 0){ + av_log(s->avctx, AV_LOG_ERROR, "sequence header damaged\n"); + return -1; + } /* we set mpeg2 parameters so that it emulates mpeg1 */ s->progressive_sequence = 1;