diff --git a/swfdec/jpeg/jpeg.c b/swfdec/jpeg/jpeg.c index d49f418..9fdc70d 100644 --- a/swfdec/jpeg/jpeg.c +++ b/swfdec/jpeg/jpeg.c @@ -69,8 +69,13 @@ jpeg_decoder_verify_header (JpegDecoder *dec) dec->error = TRUE; } - if (dec->width < 1) { - COG_ERROR("height can't be 0"); + if (dec->width < 1 || dec->height < 1) { + COG_ERROR("width and height can't be 0"); + dec->error = TRUE; + } + + if (dec->width * dec->height * dec->n_components < 1) { + COG_ERROR("image is too big"); dec->error = TRUE; }