Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 308867
Collapse All | Expand All

(-)scorched.orig/src/common/image/ImagePng.cpp (-4 / +4 lines)
Lines 189-195 bool ImagePng::loadFromBuffer(NetBuffer Link Here
189
	info_ptr = png_create_info_struct(png_ptr);
189
	info_ptr = png_create_info_struct(png_ptr);
190
	if (info_ptr == NULL)
190
	if (info_ptr == NULL)
191
	{
191
	{
192
	  png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
192
	  png_destroy_read_struct(&png_ptr, NULL, NULL);
193
	  return false;
193
	  return false;
194
	}
194
	}
195
195
Lines 200-206 bool ImagePng::loadFromBuffer(NetBuffer Link Here
200
	if (setjmp(png_jmpbuf(png_ptr)))
200
	if (setjmp(png_jmpbuf(png_ptr)))
201
	{
201
	{
202
	  /* Free all of the memory associated with the png_ptr and info_ptr */
202
	  /* Free all of the memory associated with the png_ptr and info_ptr */
203
	  png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
203
	  png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
204
	  /* If we get here, we had a problem reading the file */
204
	  /* If we get here, we had a problem reading the file */
205
	  return false;
205
	  return false;
206
	}
206
	}
Lines 258-264 bool ImagePng::loadFromBuffer(NetBuffer Link Here
258
	}
258
	}
259
	else
259
	else
260
	{
260
	{
261
		png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
261
		png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
262
262
263
		Logger::log(S3D::formatStringBuffer(
263
		Logger::log(S3D::formatStringBuffer(
264
			"Invalid PNG format.\n"
264
			"Invalid PNG format.\n"
Lines 272-278 bool ImagePng::loadFromBuffer(NetBuffer Link Here
272
	// END NEW CODE
272
	// END NEW CODE
273
273
274
	/* clean up after the read, and free any memory allocated - REQUIRED */
274
	/* clean up after the read, and free any memory allocated - REQUIRED */
275
	png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
275
	png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
276
276
277
	/* that's it */
277
	/* that's it */
278
	return true;
278
	return true;

Return to bug 308867