Commit graph

38 commits

Author SHA1 Message Date
Vivek Jadhav
2f6371b3b8 libavcdec: Add support for 4096x4096 resolution
Bug:
Test: ./avcdec

Change-Id: Ie111f58e04bbd045e94167cdb978c571662567fb
2025-07-21 22:26:42 -07:00
Vaibhav Valvaiker
3916f3eea4 mvcdec: Heap overflow in 'ih264d_read_coeff4x4_cabac'
In some erroneous fuzzer bistreams, the slice data requires more
parsing than what was implied by the distance between successive
start codes. The primary culprit is the NEXTBITS macro which requires
reading 4 additional bytes of the bitstream buffer. To alleviate
this, 16 bytes per 4x4 TU have been additionally allocated to the
bitstream buffer. Also, chroma bytes are added for 4:2:0/4:2:2.

This is in reference to commit-72315c1, where additional bytes were added to fix similar issue.

Bug = ossfuzz:42538616
Test: mvc_dec_fuzzer
2025-01-30 06:21:06 -08:00
Ashwin Natesan
72315c11ac mvcdec: Heap overflow in 'ih264d_read_coeff4x4_cabac'
In some erroneous fuzzer bistreams, the slice data requires more
parsing than what was implied by the distance between successive
start codes. The primary culprit is the NEXTBITS macro which requires
reading 4 additional bytes of the bitstream buffer. To alleviate
this, 4 bytes per 4x4 TU have been additionally allocated to the
bitstream buffer.

Bug = ossfuzz:66989
Test: mvc_dec_fuzzer
2024-05-07 11:48:55 -07:00
Ashwin Natesan
a20a5df162 mvcdec: Heap overflow in 'ih264d_parse_fgc'
Although the fag end of both the NALU and the bitstream buffer
 is being parsed, not all FGC SEI symbols would have been
decoded semantically. This commit detects and returns an error
in this situation.

Bug = ossfuzz:65418
Test: mvc_dec_fuzzer
2024-01-21 21:40:27 -08:00
Ashwin Natesan
37beb97292 mvcdec: Fixed heap overflow during SEI parsing
There can be cases where there are multiple SEI payloads within a
single SEI NAL. In the particulkar case where the payload comprises
exclusiely of FGC data, the size of the NAL can exceed the size
of the 'dynamic bitstream buffer' which is used to pass the NALU
onto its appropriate parser.

This commit adds 'imvcd_bitstream_buf_realloc' which re-allocates
the 'dynamic bitstream buffer' such that any arbitrarily sized
NALU can be stored without a heap overflow.

Bug = ossfuzz:64286
Test: svc_enc_fuzzer
2023-11-21 06:02:14 -08:00
Ashwin Natesan
8121651110 mvcdec: Integer overflow in imvcd_parse_subset_sps
The cases where the value for log2MaxPocLsb was exceeding
'MAX_BITS_IN_POC_LSB' was not being handled correctly,
which was resulting in an integer overflow. This has been
fixed.

Test: mvc_dec_fuzzer
2023-10-13 07:13:14 -07:00
Ashwin Natesan
468e048959 mvcdec: Fixes for OOB accesses of refPicList
[x] For certain sequences of modification_of_pic_nums_idc,
    OOB accessses of the aps_mod_dpb buffer within mvc_dpb_manager_t
    struct could occur. This case has been now detected
    and handled.
[x] Removed unused variables in 'imvcd_slice_functions.c'.

Test: mvc_dec_fuzzer
2023-07-26 07:34:30 -07:00
Ashwin Natesan
f8ae418b38 mvcdec: Bitstream buf allocation accounts for FGC SEI
The worst case FGC SEI payload size in cojunction with the worst
case sizes of other NALU's can be significantly larger than the
default bitstream buffer size of 256000. It is now set to the sum
of 256000 and MAX_FGC_SEI_SIZE.

Bug: ossFuzz:58190
Test: mvc_dec_fuzzer
2023-04-20 15:35:41 -07:00
Ashwin Natesan
d813b95df7
mvc: added check for incorrect pocs in DPB list
Bug: 250317489
Test: fuzzer poc in bug
Change-Id: I4defa4c3f58d3131893e694ba125b5e1a76e71ad
2022-10-06 15:22:16 +05:30
Ashwin Natesan
7e9911f8e0
mvc: added check for incorrect poc signaling
Bug: 242723830
Test: fuzzer poc in bug
Change-Id: Id52a4dfac055844bed3440e29eca924c47d4f226
2022-09-23 14:44:41 +05:30
Treehugger Robot
18763d60a2 Merge "mvc: fixed an integer overflow in prev_max_disp_seq" 2022-09-15 05:03:31 +00:00
Treehugger Robot
d46160f452 Merge "mvc: corrected logic for inserting long term refs" 2022-09-15 01:34:29 +00:00
Ashwin Natesan
aa3c12e605
mvc: fixed an integer overflow in prev_max_disp_seq
Bug: 246041870
Test: fuzzer poc in bug
Change-Id: Id4e5d358a7a8395a450f43ae8adcc1c320ffd652
2022-09-14 12:31:22 +05:30
Ashwin Natesan
c411bb53e6
mvc: corrected logic for inserting long term refs
The logic for inserting long term refs was failing
when the new ltIdx was greater than any of the
existing ltIdx in the DPB

Bug: 242723830
Test: fuzzer poc in bug
Change-Id: Iea9d71e563910a884ddfc2ddc6d6ab2b32581fde
2022-09-10 11:31:09 +05:30
Treehugger Robot
c0b08788bb Merge "mvc: added check for incorrect abs_diff_pic_num_minus1" 2022-09-07 17:36:37 +00:00
Ashwin Natesan
d2f8ae1661
mvc: added check for incorrect abs_diff_pic_num_minus1
Bug: 242723830
Test: fuzzer poc in bug
Change-Id: Ic5190ac52aa2fe145f9b7a7cbaaf5c460a7fbd01
2022-09-06 11:04:57 +05:30
Ashwin Natesan
83047b4d6e
mvc: added check for incorrect abs_diff_view_idx_minus1
abs_diff_view_idx_minus1 is present in NALU with NALUID=20
within ref_pic_list_mvc_modification

Bug: 242723830
Test: fuzzer poc in bug
Change-Id: I6ff31b3294cd01484712eebdb6bff1e336f06e38
2022-09-05 14:12:12 +05:30
Treehugger Robot
9c75f6b991 Merge "mvc: fixed an integer overflow in max_disp_seq computation" 2022-09-02 16:30:01 +00:00
Ashwin Natesan
80bba33ec2 mvc: fix integer overflows while computing display poc
Bug: 242274872
Bug: 244651074
Test: fuzzer poc in bug
Change-Id: I6c4ff7d48ea435913a79e30f3c61d93777d03975
2022-09-02 05:19:18 +00:00
Ashwin Natesan
3a6e67d2eb
mvc: fixed an integer overflow in max_disp_seq computation
Bug: 242723830
Test: fuzzer poc in bug
Change-Id: I38db0a26317c6ae978b2599cfe989a396a50c0ab
2022-08-31 20:30:58 +05:30
Treehugger Robot
b7ac6e9575 Merge "mvc: corrected handling of incorrect bitstreams in mmco parsing" 2022-08-30 15:29:42 +00:00
Ashwin Natesan
17f097626f
mvc: corrected handling of incorrect bitstreams in mmco parsing
Test: fuzzer poc in bug
Bug: 243507465
Bug: 243980319
Change-Id: Ie0fa865791948693d7cd1665965022302ec56203
2022-08-30 10:14:10 +05:30
Treehugger Robot
7215ecabd3 Merge "mvc: Fix for cases where PPS is replaced while still in use" 2022-08-24 22:25:05 +00:00
Treehugger Robot
6a99b2b6c3 Merge "mvc: Fix for with excessive number of 'modification_of_pic_nums_idc'" 2022-08-23 21:14:38 +00:00
Treehugger Robot
4a1c3fbce0 Merge "mvc: Fixed integer overflow erros while computing picNum" 2022-08-23 17:38:28 +00:00
Ashwin Natesan
f548c7afab
mvc: Fix for with excessive number of 'modification_of_pic_nums_idc'
Bug: 242600232
Test: fuzzer poc in bug
Change-Id: Ibb566320a452b38235b57bd4b7dd1215a37ca515
2022-08-20 15:58:51 +05:30
Ashwin Natesan
b1636ac734
mvc: Fix for cases where PPS is replaced while still in use
Bug: 242417287
Test: fuzzer poc in bug
Change-Id: Icb2e9a8f3f815fe7ee271c57e334e13186665e9c
2022-08-19 21:08:41 +05:30
Treehugger Robot
eda6e822bd Merge "mvc: corrected handling of incorrect bitstreams in refIdxActive parsing" 2022-08-19 15:20:56 +00:00
Treehugger Robot
c5ee6f9883 Merge "mvc: Fix for int overflow when parsing u1_bits_in_frm_num" 2022-08-19 07:46:59 +00:00
Treehugger Robot
4a169466ec Merge "mvc: Signal resolution change correctly in subset SPS" 2022-08-19 06:18:19 +00:00
Ashwin Natesan
113c748dd2
mvc: Signal resolution change correctly in subset SPS
Bug: 242500802
Test: fuzzer poc in bug
Change-Id: I1ad1e427fed56b00fc6203328fbe02bb9a453874
2022-08-18 18:49:55 +05:30
Ashwin Natesan
0f0cca684c
mvc: corrected handling of incorrect bitstreams in refIdxActive parsing
Test: fuzzer poc in bug
Bug: 242723830
Change-Id: Ib43c6d24fd45cbab7fe2a7b4b698f50e95b2092a
2022-08-18 16:00:05 +05:30
Ashwin Natesan
bb490c0067
mvc: Fix for int overflow when parsing u1_bits_in_frm_num
Bug: 242555278
Test: fuzzer poc in bug
Change-Id: Ie8b8c0a977ad827d7a05fd80b8d8186c78d2acb5
2022-08-16 16:29:40 +05:30
Treehugger Robot
5d36aabe47 Merge "mvc: Set minimum bitstream buffser size correctly" 2022-08-14 20:41:32 +00:00
Ashwin Natesan
2704594292
mvc: Fixed integer overflow erros while computing picNum
Bug: 242372644
Test: fuzzer poc in bug
Change-Id: I36b6f7df8804d45e8965a7ef1c69d5a4d4fd835f
2022-08-14 00:17:35 +05:30
Ashwin Natesan
eb3d11f42f
mvc: Set minimum bitstream buffser size correctly
Bug: 242303994
Test: fuzzer poc in bug
Change-Id: I7bc7fa05c46d9474db4fa8ee7761cf90fa6d8452
2022-08-13 12:09:58 +05:30
Ashwin Natesan
79dc65e023
mvc: Correct view id checks in SPS parsing
Corrected checks for number of views and view id
when parsing SPS in MVC decode

Bug: 241865791
Bug: 241867454
Test: fuzzer poc in the bugs
Change-Id: I8241de5c28ddbfebdb639852cf647df5e0a9487b
2022-08-12 12:13:16 +05:30
Ashwin Natesan
779bbfdb00 Decoder: MVC decoding support added
Added support for decoding 'Multiview High' profile, corresponding to
profile_idc of 118 in 'Rec. ITU-T H.264 (08/2021)'.

Bug: 232169767
Test: atest CtsMediaV2TestCases

Change-Id: I63256344a8a205e74f2bcebe555f5ba6cc3163d0
2022-08-06 05:51:31 +00:00