Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Adds test for com/google/android/exoplayer2/ext/opus/OpusDecoder class parsing. Test initially failed due to incorrect 3-byte integer parsing in the DEX encoded value parser.

Bug Fix

The encodedValueIntParser incorrectly handled sign extension for 3-byte integers in little-endian format:

// Before (incorrect): checked LSB and prepended extension byte
const firstByte = uint8Array[0];
const firstBit = (firstByte & 0b1000_0000) >> 7;
const buffer = Buffer.from([ extensionByte, ...uint8Array ]);

// After (correct): check MSB and append extension byte  
const lastByte = uint8Array[uint8Array.length - 1];
const signBit = (lastByte & 0b1000_0000) >> 7;
const buffer = Buffer.from([ ...uint8Array, extensionByte ]);

This bug caused 0xbb80 (48000) to parse as 0xbb80ff (12288255).

Changes

  • Add OpusDecoder to test suite for CID bafybeicb3qajmwy6li7hche2nkucvytaxcyxhwhphmi73tgydjzmyoqoda
  • Fix 3-byte integer sign extension to use most significant byte in little-endian order
Original prompt

This section details on the original issue you should resolve

<issue_title>Add bafybeicb3qajmwy6li7hche2nkucvytaxcyxhwhphmi73tgydjzmyoqoda + com/google/android/exoplayer2/ext/opus/OpusDecoder parseDexAgainstSmaliMacro test like others and make it pass</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: futpib <4330357+futpib@users.noreply.github.com>
Copilot AI changed the title [WIP] Add OpusDecoder parseDexAgainstSmaliMacro test Add OpusDecoder test and fix 3-byte int sign extension bug in DEX parser Nov 14, 2025
Copilot AI requested a review from futpib November 14, 2025 17:02
Copilot finished work on behalf of futpib November 14, 2025 17:02
@futpib futpib marked this pull request as ready for review November 14, 2025 17:06
@futpib futpib merged commit cb2ef7a into master Nov 14, 2025
4 checks passed
@coveralls
Copy link

coveralls commented Nov 14, 2025

Pull Request Test Coverage Report for Build 19371681162

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 94.171%

Totals Coverage Status
Change from base Build 19371639573: 0.002%
Covered Lines: 7904
Relevant Lines: 8387

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants