Commit graph

698 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
Rakesh Kumar
ba74b083b4 libavc: Fix dynamic color aspects support
Test: atest android.mediav2.cts.DecoderDynamicColorAspectTest

Change-Id: Id64ddb874efe1ab51cd9b2359bfa9526bc1ccd6e
2024-11-11 18:23:04 -08:00
Rakesh Kumar
7d6f8576e0 libavcdec: Fix integer overflow issue in ui_max_frame_num
In avc MaxFrameNum can be 65536 which is of 17 bits due to which
interger overflow was happening for i2_max_frm_num and
ui_max_frame_num. This has been fixed.

Bug: 369676522
Test: poc in bug description

Change-Id: I858eea6bf8eea1e2cee6d4a7c28a84705eb51792
2024-10-24 08:16:56 -07:00
Suyog Pawar
266cda3c3b libavc : Enable support for MacOS
Test: ./avcenc
      ./avcdec

Change-Id: If03196cf979d7f6638b99d5b13afba6df3364178
2024-10-04 06:51:30 -07:00
Suyog Pawar
045d0c9156 libavc : Fix mutex initialization index in apv_proc_start_mutex
- Changed hardcoded index [0] to loop variable [i] in ithread_mutex_init call
- Ensures correct initialization of both mutexes in the loop

Test: ./avcdec

Change-Id: I95ccd1eec5f18b5391befbcedf3546a119681b54
2024-10-04 06:50:55 -07:00
Suyog Pawar
42068b0f6c libavc: Fix poc counts for idr slice
Test: Build
Change-Id: Ic9212b86efbc54724c09164776169bfeafb15d7b
2024-08-07 05:53:55 -07:00
Mallikarjun Kamble
3899610fa8 svcdec: Handled timeout by returning status of the error
Bug = ossfuzz:67415
Test: svc_dec_fuzzer
2024-07-19 01:11:00 -07:00
Mallikarjun Kamble
b0117e32b9 svcdec: Ensure decoder display dimensions match subset sequence dimensions
- Fixes for heap buffer overflow

Bug = ossfuzz:68807, ossfuzz:69682
Test: svc_dec_fuzzer
2024-07-11 00:24:15 -07: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
Haripriya Deshmukh
828cdb77ba libavc: Add dynamic color aspects support
Bug: 325468696
Test: atest android.mediav2.cts.DecoderDynamicColorAspectTest

Change-Id: Ib33d57a1f8109a149926841fed1a3d2ff454b668
2024-04-23 23:04:49 -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
Mallikarjun Kamble
28727baf58 svcdec: oss-fuzz bug fixes
ID#
65031
65035
65057
65059
65060
65132
65172
65482
2024-01-09 07:12:29 -08:00
Mallikarjun Kamble
3cc9ff94db Update intra resamp flags 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
a8a8a80c5f Added compliance fixes 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
df740b5ebc Added fixes for hang 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
e49a9150a3 Fixes for heap overflow 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
82f4e69094 svcdec: Fixes for NULL dereferencing in inter-layer functions
Resolution level initialization is tracked in inter layer prediction functions

Bug = ossfuzz:62290
Test: svc_dec_fuzzer
2023-11-24 07:19:34 -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
Vivek Jadhav
972c0aa711 libavcdec: Fix timeout issue in AVC Decoder
Make use of cur_pps to compute the max number of frames
in decode gaps in frame num

Bug: oss-fuzz-61655
Test: avc_dec_fuzzer
2023-11-14 21:03:25 -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
srujan vandrangi
f27694faed decoder: join threads in flush mode
Test: avcdec
2023-09-25 08:47:41 -07:00
wujianxing1
283f9fcecb Correct comment spelling error.
Change-Id: Idd5e2c12da2b23f598c301bf6fb6a963c4420ae2
Signed-off-by: wujianxing1 <wujianxing1@xiaomi.corp-partner.google.com>
2023-08-11 15:54:38 -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
Srujan Vandrangi
5b04d419d2 decoder: join threads in reset()
Test: Build
2023-07-24 09:37:28 -07:00
Srujan Vandrangi
72e8241a64 decoder: replace KEEP_THREADS_ACTIVE macro with avc decoder struct variable
Bug: 289097296
Test: Build
2023-07-22 09:51:37 -07:00
Srujan Vandrangi
6685e380b5 decoder: handle error returned by ih264d_decode_gaps_in_frame_num
Bug: oss-fuzz:55598, oss-fuzz:57605, oss-fuzz:55641
Test: avc_dec_fuzzer
2023-06-21 06:51:49 -07:00
Mallikarjun Kamble
84f955dd77 svcdec: Fix for out of range reference index during base mode flag
Bug: 58278
Test: svc_dec_fuzzer
2023-04-27 07:47:13 -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
Mallikarjun Kamble
5a7d4325be svcdec: Fix for out of bound index in ii_pred
Bug: 274306469
Test: svc_dec_fuzzer
2023-03-23 12:10:07 -07:00
Harish Mahendrakar
7164209291 Updates to Android.bp and some formatting fixes
- Only libavcdec is marked as available to apex modules instead
  of marking all decoder libraries to be available to apex modules.
- some formatting changes for consistency with neighboring lines.

Test: Builds
2023-03-08 20:27:18 -08:00
chamarthi.kishore
7855d6e872 svcdec: Bug fix in header and SPS parsing w.r.t non dyadic SVC decoding
BUG=oss-fuzz: 56176
Test: svc_dec_fuzzer
2023-03-01 15:01:00 -08:00
chamarthi.kishore
3a853e8247 svcdec: Bug fix in mark_err_slice_skip funtion w.r.t thread creation
BUG=oss-fuzz: 56023, 56050, 56089
Test: svc_dec_fuzzer
2023-02-28 15:11:26 -08:00
chamarthi.kishore
a49b596b8e svcdec: Modifications to the conditions in NON VCL NAL parsing.
BUG=oss-fuzz: 56386
Test: svc_dec_fuzzer
2023-02-27 11:08:52 -08:00
chamarthi.kishore
c0ca3b2979 svcdec: Bug fix in NON VCL NAL parsing.
BUG=oss-fuzz: 56386
Test: svc_dec_fuzzer
2023-02-27 11:08:52 -08:00
chamarthi.kishore
4900778d4c svcdec: Indentation changes
BUG=oss-fuzz: 56176
Test: svc_dec_fuzzer
2023-02-25 09:26:25 -08:00
chamarthi.kishore
5fabd43f6a svcdec: Bug fix in header parsing w.r.t u1_extended_spatial_scalability_idc
BUG=oss-fuzz: 56176
Test: svc_dec_fuzzer
2023-02-25 09:26:25 -08:00
Harish Mahendrakar
a7c8d47643 Fix formatting in FGC commit 2023-02-21 12:36:55 -08:00
Shireesh Kadaramandalgi
b6b12cc5f0 libavc: Add support for FGC SEI message
- Decoder: Added support for FGC SEI parsing and exporting
2023-02-21 12:36:55 -08:00
chamarthi.kishore
992407f6c3 Resolved invalid memory access to Weighted pred offsets
BUG=oss-fuzz:56013
Test: svc_dec_fuzzer
2023-02-16 10:07:46 -08:00
Mallikarjun Kamble
7f19ac2206 Remove printf's from sei
These printf's were inserted for debugging
2023-02-14 22:00:13 -08:00
Mallikarjun Kamble
8e41a50de4 libavc: Added support for SII SEI message
- Add SII flag and SII parameters for the encoder and decoder.
- Encoder: Added support for SII SEI
- Decoder: Added support for SII SEI parsing and exporting
2023-02-14 22:00:13 -08:00
Mallikarjun Kamble
8739b7da75 svcdec: Limit min dimensions supported to 32x32
Also added macros for svc decoder max dimensions as well

BUG=oss-fuzz:55874, 55876, 55877, 55888, 55905 and 55911
Test: svc_dec_fuzzer
2023-02-14 21:55:58 -08:00
Mallikarjun Kamble
764ab7b702 Resolve the issue of non-vcl buffer overflow in nal_parse
BUG=oss-fuzz:55964
Test: svc_dec_fuzzer
2023-02-14 21:27:22 -08:00
Mallikarjun Kamble
8b8c7e390d Resolve the issue of pps and sps counter overflow
BUG=oss-fuzz:55904
Test: svc_dec_fuzzer
2023-02-14 07:53:27 -08:00
chamarthi.kishore
e6c806df90 formatting changes 2023-02-08 07:55:47 -08:00
chamarthi.kishore
308e043ef6 VUI header file changes 2023-02-08 07:55:47 -08:00
chamarthi.kishore
375b9b7e44 SVC decoder support 2023-02-08 07:55:47 -08:00
Harish Mahendrakar
2219f68d19 decoder: Fix the size check for arguments to decode call.
Fixes #2
Test: avc_dec_fuzzer
2023-01-30 12:37:18 -08:00
Harish Mahendrakar
6334fd9a1c Remove mips specific files
Test: Builds
Bug: 261484694

Change-Id: Ied9694ee9f7245e2db37ff42b7fb98cb58397af9
2022-12-06 02:52:33 +05:30