[Android] MediaWrapper: fix insertDate parcel write position

Duncan McNamara git at videolan.org
Mon May 22 13:03:35 UTC 2023


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed May 17 16:36:40 2023 +0200| [01a0e6eb449d9744e8ddf3eaba0c5d7d6a15991e] | committer: Duncan McNamara

MediaWrapper: fix insertDate parcel write position

Due to having the wrong position in the parcel creation for the media
wrapper, it caused an OOM exception. This was introduced in
6113d68fa55c94429f3f5a9f8a4a03224a0c526d

> https://code.videolan.org/videolan/vlc-android/commit/01a0e6eb449d9744e8ddf3eaba0c5d7d6a15991e
---

 .../src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java b/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
index a052f77709..3ce4fca259 100644
--- a/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
+++ b/medialibrary/src/org/videolan/medialibrary/interfaces/media/MediaWrapper.java
@@ -782,7 +782,6 @@ public abstract class MediaWrapper extends MediaLibraryItem implements Parcelabl
         dest.writeLong(getLastModified());
         dest.writeLong(getSeen());
         dest.writeInt(isPresent() ? 1 : 0);
-        dest.writeLong(mInsertionDate);
 
         if (mSlaves != null) {
             PSlave[] pslaves = new PSlave[mSlaves.length];
@@ -793,6 +792,7 @@ public abstract class MediaWrapper extends MediaLibraryItem implements Parcelabl
         } else
             dest.writeTypedArray(null, flags);
         dest.writeInt(mFavorite ? 1 : 0);
+        dest.writeLong(mInsertionDate);
     }
 
     public static final Parcelable.Creator<MediaWrapper> CREATOR = new Parcelable.Creator<MediaWrapper>() {



More information about the Android mailing list