[libav-bugs] [Bug 992] New: Null pointer dereference in generate_sliding_window_mmcos()

bugzilla at libav.org bugzilla at libav.org
Wed Dec 7 13:57:44 CET 2016


https://bugzilla.libav.org/show_bug.cgi?id=992

            Bug ID: 992
           Summary: Null pointer dereference in
                    generate_sliding_window_mmcos()
           Product: Libav
           Version: git HEAD
          Hardware: X86
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: ---
         Component: libavcodec
          Assignee: bugzilla at libav.org
          Reporter: fumfi.255 at gmail.com

Created attachment 620
  --> https://bugzilla.libav.org/attachment.cgi?id=620&action=edit
POC to trigger null pointer dereference (avconv)

After some fuzz testing I found a crashing test case.

Command: avconv -v 9 -loglevel 99 -i nullptrderef_generate_sliding_window_mmcos
-f /dev/null

Git Head: f22da2cdf90dc892d483e2d4003cffc0500816f6

Output + ASAN:

avconv version v13_dev0-588-gf22da2c, Copyright (c) 2000-2016 the Libav
developers
  built on Dec  7 2016 11:40:38 with clang version 3.9.0
(tags/RELEASE_390/final)
  configuration: --cc=afl-clang-fast
  libavutil     55. 29. 0 / 55. 29. 0
  libavcodec    57. 28. 4 / 57. 28. 4
  libavformat   57. 10. 0 / 57. 10. 0
  libavdevice   56.  1. 0 / 56.  1. 0
  libavfilter    6.  8. 0 /  6.  8. 0
  libavresample  3.  0. 0 /  3.  0. 0
  libswscale     4.  0. 0 /  4.  0. 0
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set libav* logging level) with
argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging
level) with argument '99'.
Reading option '-i' ... matched as input file with argument
'nullptrderef_generate_sliding_window_mmcos'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'/dev/null'.
Trailing options were found on the commandline.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set libav* logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input file
nullptrderef_generate_sliding_window_mmcos.
Successfully parsed a group of options.
Opening an input file: nullptrderef_generate_sliding_window_mmcos.
nsv_probe(), buf_size 36
[h264 @ 0x61a00001f280] Probed with size=2048 and score=51
[h264 @ 0x61900001ea80] missing picture in access unit
IN delayed:0 pts:-9223372036854775808, dts:-9223372036854775808 cur_dts:0 st:0
pc:0x61300000db00
OUTdelayed:0/0 pts:-9223372036854775808, dts:-9223372036854775808 cur_dts:0
[h264 @ 0x61900001ea80] Reducing left cropping to -32 chroma samples to
preserve alignment.
[h264 @ 0x61900001ea80] Invalid crop parameters
[h264 @ 0x61900001ea80] FMO not supported
IN delayed:0 pts:-9223372036854775808, dts:-9223372036854775808 cur_dts:0 st:0
pc:0x61300000db00
OUTdelayed:0/0 pts:-9223372036854775808, dts:-9223372036854775808 cur_dts:0
[AVBSFContext @ 0x60800000b6a0] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x61900001ea80] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x61900001ea80] slice type 32 too large at -1
[h264 @ 0x61900001ea80] decode_slice_header error
[h264 @ 0x61900001ea80] no frame!
[AVBSFContext @ 0x60800000b6a0] nal_unit_type: 7, nal_ref_idc: 2
[AVBSFContext @ 0x60800000b6a0] nal_unit_type: 8, nal_ref_idc: 3
[AVBSFContext @ 0x60800000b6a0] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0x61900001ea80] nal_unit_type: 7, nal_ref_idc: 2
[h264 @ 0x61900001ea80] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x61900001ea80] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0x61900001ea80] Reducing left cropping to -32 chroma samples to
preserve alignment.
[h264 @ 0x61900001ea80] Invalid crop parameters
[h264 @ 0x61900001ea80] FMO not supported
[h264 @ 0x61900001ea80] Reinit context to 16x32, pix_fmt: 0
[h264 @ 0x61900001ea80] Frame num gap 15 8
[h264 @ 0x61900001ea80] Frame num gap 15 9
[h264 @ 0x61900001ea80] Frame num gap 15 10
[h264 @ 0x61900001ea80] Frame num gap 15 11
[h264 @ 0x61900001ea80] Frame num gap 15 12
[h264 @ 0x61900001ea80] Frame num gap 15 13
[h264 @ 0x61900001ea80] error while decoding MB 0 0, bytestream -3
[h264 @ 0x61900001ea80] Reducing left cropping to 0 chroma samples to preserve
alignment.
[h264 @ 0x61900001ea80] Invalid crop parameters
[h264 @ 0x61900001ea80] missing picture in access unit
IN delayed:0 pts:-9223372036854775808, dts:-9223372036854775808 cur_dts:0 st:0
pc:0x61300000db00
OUTdelayed:0/0 pts:-9223372036854775808, dts:-9223372036854775808 cur_dts:0
[h264 @ 0x61900001ea80] nal_unit_type: 7, nal_ref_idc: 2
[h264 @ 0x61900001ea80] Reducing left cropping to 0 chroma samples to preserve
alignment.
[h264 @ 0x61900001ea80] Invalid crop parameters
ASAN:DEADLYSIGNAL
=================================================================
==16049==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000030 (pc
0x000001cc1d1a bp 0x000000000000 sp 0x7ffcdd125330 T0)
==16049==The signal is caused by a READ memory access.
==16049==Hint: address points to the zero page.
    #0 0x1cc1d19 in generate_sliding_window_mmcos
XYZ/libav/libavcodec/h264_refs.c:536:62
    #1 0x1cc1d19 in ff_h264_execute_ref_pic_marking
XYZ/libav/libavcodec/h264_refs.c:561
    #2 0x1cbc4ce in ff_h264_field_end
XYZ/libav/libavcodec/h264_picture.c:157:19
    #3 0xc9eeee in h264_decode_frame XYZ/libav/libavcodec/h264dec.c:760:9
    #4 0xa9b549 in avcodec_decode_video2 XYZ/libav/libavcodec/decode.c:320:19
    #5 0xa9a46e in do_decode XYZ/libav/libavcodec/decode.c:168:15
    #6 0xa99612 in avcodec_send_packet XYZ/libav/libavcodec/decode.c:245:12
    #7 0x8dc07b in try_decode_frame XYZ/libav/libavformat/utils.c:1950:19
    #8 0x8d5bc3 in avformat_find_stream_info
XYZ/libav/libavformat/utils.c:2459:9
    #9 0x4f8701 in open_input_file XYZ/libav/avconv_opt.c:771:11
    #10 0x4f7394 in open_files XYZ/libav/avconv_opt.c:2408:15
    #11 0x4f6bd2 in avconv_parse_options XYZ/libav/avconv_opt.c:2445:11
    #12 0x51c0cf in main XYZ/libav/avconv.c:2876:11
    #13 0x7f3743c0e82f in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #14 0x41af48 in _start (/usr/local/bin/avconv+0x41af48)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV XYZ/libav/libavcodec/h264_refs.c:536:62 in
generate_sliding_window_mmcos
==16049==ABORTING

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-bugs/attachments/20161207/666da404/attachment.html>


More information about the libav-bugs mailing list