{"action":"created","issue":{"url":"https://api.github.com/repos/thomaslevesque/WpfAnimatedGif/issues/13","labels_url":"https://api.github.com/repos/thomaslevesque/WpfAnimatedGif/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/thomaslevesque/WpfAnimatedGif/issues/13/comments","events_url":"https://api.github.com/repos/thomaslevesque/WpfAnimatedGif/issues/13/events","html_url":"https://github.com/thomaslevesque/WpfAnimatedGif/issues/13","id":55458378,"number":13,"title":"NullReferenceException Windows XP - v1.4.12","user":{"login":"hawelo","id":10705630,"avatar_url":"https://avatars.githubusercontent.com/u/10705630?v=3","gravatar_id":"","url":"https://api.github.com/users/hawelo","html_url":"https://github.com/hawelo","followers_url":"https://api.github.com/users/hawelo/followers","following_url":"https://api.github.com/users/hawelo/following{/other_user}","gists_url":"https://api.github.com/users/hawelo/gists{/gist_id}","starred_url":"https://api.github.com/users/hawelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawelo/subscriptions","organizations_url":"https://api.github.com/users/hawelo/orgs","repos_url":"https://api.github.com/users/hawelo/repos","events_url":"https://api.github.com/users/hawelo/events{/privacy}","received_events_url":"https://api.github.com/users/hawelo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-01-26T08:48:42Z","updated_at":"2015-01-27T10:33:50Z","closed_at":null,"body":"Hi,\r\nI'm getting following exception on Windows XP SP3 with the version 1.4.12:\r\n\r\nSystem.NullReferenceException: Object reference not set to an instance of an object.\r\nat WpfAnimatedGif.ImageBehavior.GetQueryOrDefault[T](BitmapMetadata metadata, String query, T defaultValue)\r\nat WpfAnimatedGif.ImageBehavior.GetFullSize(BitmapDecoder decoder, GifFile gifMetadata)\r\nat WpfAnimatedGif.ImageBehavior.GetAnimation(Image imageControl, BitmapSource source)\r\nat WpfAnimatedGif.ImageBehavior.InitAnimationOrImage(Image imageControl)\r\nat WpfAnimatedGif.ImageBehavior.ImageControlLoaded(Object sender, RoutedEventArgs e)\r\n...\r\n\r\nIt works well on Windows Vista,7 and 8.1."},"comment":{"url":"https://api.github.com/repos/thomaslevesque/WpfAnimatedGif/issues/comments/71623824","html_url":"https://github.com/thomaslevesque/WpfAnimatedGif/issues/13#issuecomment-71623824","issue_url":"https://api.github.com/repos/thomaslevesque/WpfAnimatedGif/issues/13","id":71623824,"user":{"login":"thomaslevesque","id":1864281,"avatar_url":"https://avatars.githubusercontent.com/u/1864281?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaslevesque","html_url":"https://github.com/thomaslevesque","followers_url":"https://api.github.com/users/thomaslevesque/followers","following_url":"https://api.github.com/users/thomaslevesque/following{/other_user}","gists_url":"https://api.github.com/users/thomaslevesque/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaslevesque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaslevesque/subscriptions","organizations_url":"https://api.github.com/users/thomaslevesque/orgs","repos_url":"https://api.github.com/users/thomaslevesque/repos","events_url":"https://api.github.com/users/thomaslevesque/events{/privacy}","received_events_url":"https://api.github.com/users/thomaslevesque/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T10:33:50Z","updated_at":"2015-01-27T10:33:50Z","body":"> In this case, I need to hold the MemoryStream open, otherwise, I will get an exception when reading the metadata\r\n\r\nWell, depending on when and how you load the image, it could work even if you close the stream. If you use CacheOption = OnLoad, and set the AnimatedSource when the image control is loaded, it should work fine. But this solution is a bit brittle...\r\n\r\n> I could solve this problem by saving the GIF to the file system and creating the BitmapImage with specified UriSource. This works well on all systems.\r\n\r\nYes, this is probably your safest bet."}}