microsoft / microsoft/Windows-classic-samples

x64 runtime crash issue with WicAnimatedGif sample

Open Beginner friendly
#255 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
5.7k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

We can compile the https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/Win7Samples/multimedia/wic/wicanimatedgif sample successfully but it crashes at execution here:

https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/Win7Samples/multimedia/wic/wicanimatedgif/WicAnimatedGif.cpp#L445

SetWindowLongPtr(hWnd, GWLP_USERDATA, PtrToUlong(pThis));

I think this line should be replaced by

SetWindowLongPtr(hWnd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(pThis));

which compiles and runs fine.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

In Samples/Win7Samples/multimedia/wic/wicanimatedgif/WicAnimatedGif.cpp around line 445, inspect the x64 window user-data assignment and compare it with the pointer conversion proposed in the issue. Build and run the WicAnimatedGif sample for x64; done when it executes without the reported crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.