Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba765543 authored by Mike Lockwood's avatar Mike Lockwood
Browse files

MTP: Fix problems with signed ints in MtpCursor.cpp



BUG: 2978335

Change-Id: Ie9f3dea3b88b00a555e1ca3232f196e83ee7a6da
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 62275a46
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -66,7 +66,8 @@ namespace android {
#define OBJECT_THUMB                221

MtpCursor::MtpCursor(MtpClient* client, int queryType, int deviceID,
                int storageID, int objectID, int columnCount, int* columns)
                MtpStorageID storageID, MtpObjectHandle objectID,
                int columnCount, int* columns)
        :   mClient(client),
            mQueryType(queryType),
            mDeviceID(deviceID),
@@ -427,7 +428,8 @@ bool MtpCursor::putString(CursorWindow* window, const char* text, int row, int c
    return true;
}

bool MtpCursor::putThumbnail(CursorWindow* window, int objectID, int format, int row, int column) {
bool MtpCursor::putThumbnail(CursorWindow* window, MtpObjectHandle objectID,
                            MtpObjectFormat format, int row, int column) {
    MtpDevice* device = mClient->getDevice(mDeviceID);
    void* thumbnail;
    int size, offset;
+11 −9
Original line number Diff line number Diff line
@@ -39,14 +39,15 @@ private:
    MtpClient*      mClient;
    int             mQueryType;
    int             mDeviceID;
    int         mStorageID;
    int         mQbjectID;
    MtpStorageID    mStorageID;
    MtpObjectHandle mQbjectID;
    int             mColumnCount;
    int*            mColumns;

public:
                MtpCursor(MtpClient* client, int queryType, int deviceID,
                        int storageID, int objectID, int columnCount, int* columns);
                        MtpStorageID storageID, MtpObjectHandle objectID,
                        int columnCount, int* columns);
    virtual     ~MtpCursor();

    int         fillWindow(CursorWindow* window, int startPos);
@@ -68,7 +69,8 @@ private:
    bool        prepareRow(CursorWindow* window);
    bool        putLong(CursorWindow* window, int value, int row, int column);
    bool        putString(CursorWindow* window, const char* text, int row, int column);
    bool        putThumbnail(CursorWindow* window, int objectID, int format, int row, int column);
    bool        putThumbnail(CursorWindow* window, MtpObjectHandle objectID,
                            MtpObjectFormat format, int row, int column);
};

}; // namespace android