Skip to content

Commit

Permalink
Add null pointer check for CopyInto. (#4671)
Browse files Browse the repository at this point in the history
memcpy to a nullptr is technically undefined behavior. Add a null check
to possibly avoid crashing.

b/388593093
  • Loading branch information
jellefoks authored Jan 9, 2025
1 parent 400bbe9 commit 8616801
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion starboard/android/shared/media_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ bool MediaDecoder::ProcessOneInputBuffer(
ReportError(kSbPlayerErrorDecode, error_message);
return false;
}
byte_buffer.CopyInto(data, size);
if (data) {
byte_buffer.CopyInto(data, size);
}
}

jint status;
Expand Down

0 comments on commit 8616801

Please sign in to comment.