Codebase list faad2 / b9862e2
main: fix crash with unsupported MP4 files aac_frame_decode returns NULL on failure. decodeMP4file should consequently NULL-check NeAACDecDecode's return pointer before doing anything with it. Not doing so leads to undefined behavior (division by zero, NULL pointer dereference, etc.) add missing NULL-check. fixes #13. Hugo Lefeuvre authored 4 years ago Hugo Lefeuvre committed 4 years ago
1 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
914914
915915 sample_buffer = NeAACDecDecode(hDecoder, &frameInfo, mp4config.bitbuf.data, mp4config.bitbuf.size);
916916
917 if (!sample_buffer) {
918 /* unable to decode file, abort */
919 break;
920 }
921
917922 if (adts_out == 1)
918923 {
919924 adtsData = MakeAdtsHeader(&adtsDataSize, &frameInfo, 0);
13641369 #else
13651370 return faad_main(argc, argv);
13661371 #endif
1367 }
1372 }