Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8961899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:59:55+00:00 2026-06-15T15:59:55+00:00

I threw the lodePNG sample files into a blank project in Visual C++ 2008

  • 0

I threw the lodePNG sample files into a blank project in Visual C++ 2008 Express, along with a 7kb PNG file I made, but I’m getting this memory allocation error during runtime:

Invalid allocation size: 429967295 bytes.

After breaking on the error & backtracking through stack frames, I think it’s being caused by a null argument being passed to the resize function in std::vector. This project was recently updated (April 2012), and is pretty thoroughly documented, so it’s possible that I’m doing something wrong (or don’t have the right compilation options). Would someone please take a look at my project?

Here’s a ZIP file of the project folder: http://www.mediafire.com/file/791b9z9ld74n3eu/TestLodePNG.zip

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:59:57+00:00Added an answer on June 15, 2026 at 3:59 pm

    You most likely have the png file in the wrong place. By default, the working directory is where the project file is, not where the solution file is when running in the debugger. When I moved the file to the project file directory it worked fine.

    You might consider adding some error checking to the the file opening code, like this:

    void load_file(std::vector<unsigned char>& buffer, const std::string& filename)
    {
      std::ifstream file(filename.c_str(), std::ios::in|std::ios::binary|std::ios::ate);
    
        if(!file)
        {
            //Do something about the error and don't crash
        }
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using minidom to parse an xml file and it threw an error indicating
Several times I got into conditions my scripts threw alerts in high rates. While
I tried to run a jar file on nodejs but it threw out a
Worked fine before I threw it into a class. Any help for resolving this
Download repro project Edit The solution working sometimes completely threw me off my initial
In VSTO (Visual studio to Office) project I am getting following exception: Error: type
Try this sample code I threw together to illustrate a point: <?php $url =
I have a multipart format text file. i am going threw the file looking
So recently Microsoft threw the joke that was IE6 into the recycling bin, and
I used JSLint on a zepto extension js file It threw the error: Unexpected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.