openh264 icon indicating copy to clipboard operation
openh264 copied to clipboard

fuzz issue 18458

Open sijchen opened this issue 7 years ago • 4 comments

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18458

INFO: Loaded 1 PC tables (7332 PCs): 7332 [0x8379c10,0x8388130),

  | /mnt/scratch0/clusterfuzz/bot/builds/clusterfuzz-builds-i386_openh264_bc9badabd72f3ca917863fe37b13183bc37b8f1a/revisions/decoder_fuzzer: Running 1 inputs 100 time(s) each.   | Running: /crash-9683c3493f1651af5dd591bd124e267b271b336e   | =================================================================   | ==1==ERROR: AddressSanitizer: heap-use-after-free on address 0xf5b01a17 at pc 0x081f0d87 bp 0xfff4f2e8 sp 0xfff4f2e0   | WRITE of size 1 at 0xf5b01a17 thread T0   | SCARINESS: 41 (1-byte-write-heap-use-after-free)   | #0 0x81f0d86 in WelsDec::SetUnRef(WelsDec::SPicture*) openh264/codec/decoder/core/src/manage_dec_ref.cpp:89:50   | #1 0x81f72e5 in WelsDec::SlidingWindow(WelsDec::TagWelsDecoderContext*, WelsDec::TagRefPic*) openh264/codec/decoder/core/src/manage_dec_ref.cpp:762:9   | #2 0x81f5f42 in WelsDec::WelsMarkAsRef(WelsDec::TagWelsDecoderContext*, WelsDec::SPicture*) openh264/codec/decoder/core/src/manage_dec_ref.cpp:624:14   | #3 0x81e0bbf in WelsDec::MarkECFrameAsRef(WelsDec::TagWelsDecoderContext*) openh264/codec/decoder/core/src/error_concealment.cpp:434:18   | #4 0x81dad76 in WelsDec::CheckAndFinishLastPic(WelsDec::TagWelsDecoderContext*, unsigned char**, TagBufferInfo*) openh264/codec/decoder/core/src/decoder_core.cpp:2803:13   | #5 0x81b9b7a in WelsDecodeBs openh264/codec/decoder/core/src/decoder.cpp:834:7   | #6 0x81aaf87 in WelsDec::CWelsDecoder::DecodeFrame2(unsigned char const*, int, unsigned char**, TagBufferInfo*) openh264/codec/decoder/plus/src/welsDecoderExt.cpp:583:3   | #7 0x81aa92e in WelsDec::CWelsDecoder::DecodeFrameNoDelay(unsigned char const*, int, unsigned char**, TagBufferInfo*) openh264/codec/decoder/plus/src/welsDecoderExt.cpp:503:15   | #8 0x81a6e89 in LLVMFuzzerTestOneInput /src/decoder_fuzzer.cpp:75:15   | #9 0x80abcd6 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned int) /src/llvm/projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:556:15

testcase-minimized-decoder_fuzzer-6260234055581696.log clusterfuzz-testcase-decoder_fuzzer-5755524074700800.zip.log

sijchen avatar Oct 22 '19 17:10 sijchen

I confirmed that this bug can be reproduced before the merge of the first commit of thread decoding support. So this bug is not related to thread decoding support.

xiaotianshi2 avatar Oct 24 '19 04:10 xiaotianshi2

@sijchen @xiaotianshi2 how to reproduce it? I tested by USE_ASAN=Yes, unzipped and renamed the attachment as .264 file. But no error occurs.

huili2 avatar Oct 24 '19 06:10 huili2

I am going to fix this issue first. By doing so, I'll need to re-create #PR commit-3 of multi-thread support (will close #PR 3187) as it may causes merge conflict.

xiaotianshi2 avatar Oct 25 '19 15:10 xiaotianshi2

@sijchen @huili2 The fix has been verified by fuzz. Can you close the issue? Thanks

xiaotianshi2 avatar Oct 29 '19 16:10 xiaotianshi2