Mercurial > libavcodec.hg
comparison huffyuv.c @ 3201:35f5c9a8bc83 libavcodec
segfault fix
author | michael |
---|---|
date | Sat, 18 Mar 2006 02:29:58 +0000 |
parents | 8d1b2cc2a75b |
children | 823272bdb4f7 |
comparison
equal
deleted
inserted
replaced
3200:646f6344472d | 3201:35f5c9a8bc83 |
---|---|
806 table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size); | 806 table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size); |
807 if(table_size < 0) | 807 if(table_size < 0) |
808 return -1; | 808 return -1; |
809 } | 809 } |
810 | 810 |
811 if((unsigned)(buf_size-table_size) >= INT_MAX/8) | |
812 return -1; | |
813 | |
811 init_get_bits(&s->gb, s->bitstream_buffer+table_size, (buf_size-table_size)*8); | 814 init_get_bits(&s->gb, s->bitstream_buffer+table_size, (buf_size-table_size)*8); |
812 | 815 |
813 fake_ystride= s->interlaced ? p->linesize[0]*2 : p->linesize[0]; | 816 fake_ystride= s->interlaced ? p->linesize[0]*2 : p->linesize[0]; |
814 fake_ustride= s->interlaced ? p->linesize[1]*2 : p->linesize[1]; | 817 fake_ustride= s->interlaced ? p->linesize[1]*2 : p->linesize[1]; |
815 fake_vstride= s->interlaced ? p->linesize[2]*2 : p->linesize[2]; | 818 fake_vstride= s->interlaced ? p->linesize[2]*2 : p->linesize[2]; |