Check for NULL before dereferencing the pointer. CID 1050
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27741 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
717326c223
commit
e32494d24f
@ -70,6 +70,8 @@ MediaFilePlayer::MediaFilePlayer(const char *media_type,
|
||||
|
||||
for (int i=0; i < fPlayFile->CountTracks(); i++) {
|
||||
BMediaTrack *track = fPlayFile->TrackAt(i);
|
||||
if (track == NULL)
|
||||
continue;
|
||||
fPlayFormat.type = B_MEDIA_RAW_AUDIO;
|
||||
fPlayFormat.u.raw_audio.buffer_size = 256;
|
||||
if ((track->DecodedFormat(&fPlayFormat) == B_OK)
|
||||
@ -77,8 +79,7 @@ MediaFilePlayer::MediaFilePlayer(const char *media_type,
|
||||
fPlayTrack = track;
|
||||
break;
|
||||
}
|
||||
if (track)
|
||||
fPlayFile->ReleaseTrack(track);
|
||||
fPlayFile->ReleaseTrack(track);
|
||||
}
|
||||
|
||||
if (fPlayTrack == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user