Skip to content

Commit

Permalink
Check for error after each channel decode.
Browse files Browse the repository at this point in the history
hInfo->error is reset within the decode_* functions. This caused the decoder
to ignore errors for some channels in the error resilience (ER) code path.

Fixes knik0#58.
  • Loading branch information
awesie committed Oct 9, 2020
1 parent 34534b2 commit 7778bb8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions libfaad/syntax.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,37 +535,61 @@ void raw_data_block(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo,
break;
case 3:
decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
break;
case 4:
decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
if (hInfo->error > 0)
return;
break;
case 5:
decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
break;
case 6:
decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
if (hInfo->error > 0)
return;
break;
case 7: /* 8 channels */
decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
decode_cpe(hDecoder, hInfo, ld, ID_CPE);
if (hInfo->error > 0)
return;
decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
if (hInfo->error > 0)
return;
Expand Down

0 comments on commit 7778bb8

Please sign in to comment.