Permalink
Browse files

Fix #1078 by removing a DCHECK for valid image dimensions.

  • Loading branch information...
jeffkaufman authored and crowell committed May 14, 2015
1 parent 7a3fab0 commit 166151ff0ab4bddd42c9a6ce4211c1c5832e780f
@@ -742,10 +742,8 @@ bool ImageRewriteFilter::ResizeImageIfNecessary(
ImageDim image_dim;
image->Dimensions(&image_dim);

DCHECK(image_dim.width() > 0 && image_dim.height() > 0);
if (image_dim.width() == 0 || image_dim.height() == 0) {
cached->add_debug_message(
"Cannot resize: Image must have nonzero dimensions");
if (image_dim.width() <= 0 || image_dim.height() <= 0) {
cached->add_debug_message("Cannot resize: Image must be at least 1x1");
return false;
}

@@ -3379,13 +3379,8 @@ TEST_F(ImageRewriteTest, ResizeEmptyImageUsingRenderedDimensions) {

finder->set_rendered_images(rendered_images);

#ifdef NDEBUG
TestSingleRewrite(kEmptyScreenGifFile, kContentTypeGif, kContentTypeGif,
"", "", false, false);
#else
EXPECT_DEATH(TestSingleRewrite(kEmptyScreenGifFile, kContentTypeGif,
kContentTypeGif, "", "", false, false), "");
#endif
}

TEST_F(ImageRewriteTest, PreserveUrlRelativity) {

0 comments on commit 166151f

Please sign in to comment.