Skip to content

Commit

Permalink
rv34: Check the return value from ff_rv34_decode_init
Browse files Browse the repository at this point in the history
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
Signed-off-by: Martin Storsjö <[email protected]>
  • Loading branch information
mstorsjo committed Sep 17, 2013
1 parent 569d18a commit 711c970
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion libavcodec/rv30.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row)
static av_cold int rv30_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
int ret;

r->rv30 = 1;
ff_rv34_decode_init(avctx);
if ((ret = ff_rv34_decode_init(avctx)) < 0)
return ret;
if(avctx->extradata_size < 2){
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return -1;
Expand Down
4 changes: 3 additions & 1 deletion libavcodec/rv40.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,11 @@ static void rv40_loop_filter(RV34DecContext *r, int row)
static av_cold int rv40_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
int ret;

r->rv30 = 0;
ff_rv34_decode_init(avctx);
if ((ret = ff_rv34_decode_init(avctx)) < 0)
return ret;
if(!aic_top_vlc.bits)
rv40_init_tables();
r->parse_slice_header = rv40_parse_slice_header;
Expand Down

0 comments on commit 711c970

Please sign in to comment.