# HG changeset patch # User kostya # Date 1268118874 0 # Node ID da870c6f71ce3fa95bd6e3c5b45b682b4d3667c5 # Parent b1b2215cb7c7d1d940879d8bf89790e475c95075 Check for reference frames so RV 3/4 won't segfault trying to copy data from nonexisting reference. diff -r b1b2215cb7c7 -r da870c6f71ce rv34.c --- a/rv34.c Tue Mar 09 06:52:33 2010 +0000 +++ b/rv34.c Tue Mar 09 07:14:34 2010 +0000 @@ -1452,8 +1452,12 @@ av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n"); return -1; } + if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_P_TYPE) + return -1; if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE) return -1; + if((!s->next_picture_ptr || !s->next_picture_ptr->data[0]) && si.type == FF_B_TYPE) + return -1; /* skip b frames if we are in a hurry */ if(avctx->hurry_up && si.type==FF_B_TYPE) return buf_size; if( (avctx->skip_frame >= AVDISCARD_NONREF && si.type==FF_B_TYPE)