Skip to content

[video_player_avplay] Fix picture subtitle display issue#964

Merged
xiaowei-guan merged 2 commits intoflutter-tizen:masterfrom
gin7773:fix-picture-subtitle-display-issue
Mar 3, 2026
Merged

[video_player_avplay] Fix picture subtitle display issue#964
xiaowei-guan merged 2 commits intoflutter-tizen:masterfrom
gin7773:fix-picture-subtitle-display-issue

Conversation

@gin7773
Copy link
Contributor

@gin7773 gin7773 commented Mar 3, 2026

Main changes:

  • Fix picture subtitle display issue

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables picture subtitle display for DASH streams by removing conditional compilation flags in plus_player.cc. However, the newly exposed code contains unsafe numeric operations on untrusted input, which could lead to integer overflows, undefined behavior, and out-of-bounds reads. This poses a significant security risk, potentially causing a denial-of-service (crash) or memory corruption when processing malicious subtitle data. The package version has also been updated to 0.8.3 in pubspec.yaml, CHANGELOG.md, and README.md.

}

if (type == plusplayer::SubtitleType::kPicture) {
#ifdef PICTURE_SUBTITLE_SUPPORT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The removal of #ifdef PICTURE_SUBTITLE_SUPPORT enables code that processes picture subtitles. This code contains several unsafe numeric operations on untrusted input (picture_width and picture_height from the player).

  1. Undefined Behavior (UB) in channels calculation (line 1330): int channels = size / area;. If area is very small (e.g., due to underflow of picture_width * picture_height), size / area can result in Inf. Casting Inf to int is undefined behavior.
  2. Integer Overflow in stride_in_bytes (line 1335): int stride_in_bytes = static_cast<int>(picture_width) * channels;. If picture_width is large (e.g., 2e9) and channels is 2, the product overflows int.
  3. Undefined Behavior in static_cast<int>(picture_width) (line 1335, 1339): If picture_width exceeds INT_MAX, the cast is undefined behavior.

These issues can lead to an incorrect stride_in_bytes or dimensions being passed to stbi_write_png_to_mem (line 1337), which can cause an out-of-bounds read from the data buffer, potentially leading to a crash (DoS) or memory corruption.

@xiaowei-guan xiaowei-guan merged commit c06a432 into flutter-tizen:master Mar 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants