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

Commit 7e05d5ef authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MediaMetadataRetriever: Fix null pointer exception"

parents e5ade59a a77c8dff
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -464,11 +464,13 @@ static jobject android_media_MediaMetadataRetriever_getThumbnailImageAtIndex(
                || thumbPixels * 6 >= maxPixels) {
            frameMemory = retriever->getImageAtIndex(
                    index, colorFormat, false /*metaOnly*/, true /*thumbnail*/);
            if (frameMemory != 0) {
                // TODO: Using unsecurePointer() has some associated security pitfalls
                //       (see declaration for details).
                //       Either document why it is safe in this case or address the
                //       issue (e.g. by copying).
                videoFrame = static_cast<VideoFrame *>(frameMemory->unsecurePointer());
            }

            if (thumbPixels > maxPixels) {
                int downscale = ceil(sqrt(thumbPixels / (float)maxPixels));