History

Merge pull request #66 from awesie/awesie-fix-4

Fix additional crashes.

Fabian Greffrath committed 6 years ago

Commit e8aa1c92 parents f1e19ef 4ed30d32 files · +28 −0Browse files

Unified · Split

2 files
  1. frontend/main.c +4 −0
  2. libfaad/syntax.c +24 −0
frontend/main.c+4−0
@@ -699,6 +699,10 @@ static int decodeAACfile(char *aacfile, char *sndfile, char *adts_fn, int to_std · 698 unmodified lines
699699 /* update buffer indices */
700700 advance_buffer(&b, frameInfo.bytesconsumed);
701701
702+ /* check if the inconsistent number of channels */
703+ if (aufile != NULL && frameInfo.channels != aufile->channels)
704+ frameInfo.error = 12;
705+
702706 if (frameInfo.error > 0)
703707 {
704708 faad_fprintf(stderr, "Error: %s\n",
libfaad/syntax.c+24−0
@@ -539,37 +539,61 @@ void raw_data_block(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo, · 538 unmodified lines
539539 break;
540540 case 3:
541541 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
542+ if (hInfo->error > 0)
543+ return;
542544 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
543545 if (hInfo->error > 0)
544546 return;
545547 break;
546548 case 4:
547549 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
550+ if (hInfo->error > 0)
551+ return;
548552 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
553+ if (hInfo->error > 0)
554+ return;
549555 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
550556 if (hInfo->error > 0)
551557 return;
552558 break;
553559 case 5:
554560 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
561+ if (hInfo->error > 0)
562+ return;
555563 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
564+ if (hInfo->error > 0)
565+ return;
556566 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
557567 if (hInfo->error > 0)
558568 return;
559569 break;
560570 case 6:
561571 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
572+ if (hInfo->error > 0)
573+ return;
562574 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
575+ if (hInfo->error > 0)
576+ return;
563577 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
578+ if (hInfo->error > 0)
579+ return;
564580 decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
565581 if (hInfo->error > 0)
566582 return;
567583 break;
568584 case 7: /* 8 channels */
569585 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
586+ if (hInfo->error > 0)
587+ return;
570588 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
589+ if (hInfo->error > 0)
590+ return;
571591 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
592+ if (hInfo->error > 0)
593+ return;
572594 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
595+ if (hInfo->error > 0)
596+ return;
573597 decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
574598 if (hInfo->error > 0)
575599 return;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t