Fixed prevent issues
[apps/osp/Gallery.git] / src / GlThumbnailProvider.cpp
index 810553a..14a4083 100644 (file)
@@ -369,24 +369,19 @@ ThumbnailProvider::GetThumbnailInfoN(const ContentId& contentId) const
                                }
                        }
                        pBitmap->Scale(DIMENSION_DEFAULT_THUMBNAIL);
-               }
-               else
-               {
-                       delete pContentInfo;
-                       AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
 
-                       return null;
-               }
+                       ContentType contentType = pContentInfo->GetContentType();
 
-               ContentType contentType = pContentInfo->GetContentType();
-               if (contentType == CONTENT_TYPE_VIDEO)
-               {
-                       VideoContentInfo* pVideoContentInfo = static_cast<VideoContentInfo*>(pContentInfo);
-                       duration = pVideoContentInfo->GetDuration();
+                       if (contentType == CONTENT_TYPE_VIDEO)
+                       {
+                               VideoContentInfo* pVideoContentInfo = static_cast<VideoContentInfo*>(pContentInfo);
+                               duration = pVideoContentInfo->GetDuration();
+                       }
+
+                       pNewThumbnailInfo = new (std::nothrow) ThumbnailInfo();
+                       pNewThumbnailInfo->Construct(contentId, pContentInfo->GetContentPath(), *pBitmap, contentType, duration);
+                       delete pBitmap;
                }
-               pNewThumbnailInfo = new (std::nothrow) ThumbnailInfo();
-               pNewThumbnailInfo->Construct(contentId, pContentInfo->GetContentPath(), *pBitmap, contentType, duration);
-               delete pBitmap;
        }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));