Skip to content

Commit

Permalink
dca: handle errors from dca_decode_block()
Browse files Browse the repository at this point in the history
Return error if core block decoding fails.
Do not enable XCh if XCh extension block decoding fails.
  • Loading branch information
justinruggles committed Oct 29, 2011
1 parent aae6eea commit 272fcc3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libavcodec/dca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,10 @@ static int dca_decode_frame(AVCodecContext * avctx,
s->profile = FF_PROFILE_DTS;

for (i = 0; i < (s->sample_blocks / 8); i++) {
dca_decode_block(s, 0, i);
if ((ret = dca_decode_block(s, 0, i))) {
av_log(avctx, AV_LOG_ERROR, "error decoding block\n");
return ret;
}
}

/* record number of core channels incase less than max channels are requested */
Expand Down Expand Up @@ -1724,7 +1727,10 @@ static int dca_decode_frame(AVCodecContext * avctx,
dca_parse_audio_coding_header(s, s->xch_base_channel);

for (i = 0; i < (s->sample_blocks / 8); i++) {
dca_decode_block(s, s->xch_base_channel, i);
if ((ret = dca_decode_block(s, s->xch_base_channel, i))) {
av_log(avctx, AV_LOG_ERROR, "error decoding XCh extension\n");
continue;
}
}

s->xch_present = 1;
Expand Down

0 comments on commit 272fcc3

Please sign in to comment.