Commit 7b3cd23f authored by michael's avatar michael

fix segfault with dracula.4xm

closes issue132


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10392 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 25436408
...@@ -301,11 +301,17 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo ...@@ -301,11 +301,17 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
const int index= size2index[log2h][log2w]; const int index= size2index[log2h][log2w];
const int h= 1<<log2h; const int h= 1<<log2h;
int code= get_vlc2(&f->gb, block_type_vlc[1-f->version][index].table, BLOCK_TYPE_VLC_BITS, 1); int code= get_vlc2(&f->gb, block_type_vlc[1-f->version][index].table, BLOCK_TYPE_VLC_BITS, 1);
uint16_t *start= f->last_picture.data[0];
uint16_t *end= start + stride*(f->avctx->height-h+1) - (1<<log2w);
assert(code>=0 && code<=6); assert(code>=0 && code<=6);
if(code == 0){ if(code == 0){
src += f->mv[ *f->bytestream++ ]; src += f->mv[ *f->bytestream++ ];
if(start > src || src > end){
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
}
mcdc(dst, src, log2w, h, stride, 1, 0); mcdc(dst, src, log2w, h, stride, 1, 0);
}else if(code == 1){ }else if(code == 1){
log2h--; log2h--;
...@@ -319,6 +325,10 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo ...@@ -319,6 +325,10 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo
mcdc(dst, src, log2w, h, stride, 1, 0); mcdc(dst, src, log2w, h, stride, 1, 0);
}else if(code == 4){ }else if(code == 4){
src += f->mv[ *f->bytestream++ ]; src += f->mv[ *f->bytestream++ ];
if(start > src || src > end){
av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
return;
}
mcdc(dst, src, log2w, h, stride, 1, le2me_16(*f->wordstream++)); mcdc(dst, src, log2w, h, stride, 1, le2me_16(*f->wordstream++));
}else if(code == 5){ }else if(code == 5){
mcdc(dst, src, log2w, h, stride, 0, le2me_16(*f->wordstream++)); mcdc(dst, src, log2w, h, stride, 0, le2me_16(*f->wordstream++));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment