diff --git a/image/decoders/nsPNGDecoder.cpp b/image/decoders/nsPNGDecoder.cpp index 13b0763bd..6c13234b6 100644 --- a/image/decoders/nsPNGDecoder.cpp +++ b/image/decoders/nsPNGDecoder.cpp @@ -837,10 +837,14 @@ nsPNGDecoder::frame_info_callback(png_structp png_ptr, png_uint_32 frame_num) width = png_get_next_frame_width(png_ptr, decoder->mInfo); height = png_get_next_frame_height(png_ptr, decoder->mInfo); - if (width == 0) - png_error(png_ptr, "Frame width must not be 0"); - if (height == 0) - png_error(png_ptr, "Frame height must not be 0"); + if (width == 0) { + PR_LOG(GetPNGLog(), PR_LOG_ERROR, ("libpng error: Frame width must not be 0\n")); + longjmp(png_jmpbuf(png_ptr), 1); + } + if (height == 0) { + PR_LOG(GetPNGLog(), PR_LOG_ERROR, ("libpng error: Frame height must not be 0\n")); + longjmp(png_jmpbuf(png_ptr), 1); + } decoder->CreateFrame(x_offset, y_offset, width, height, decoder->format);