diff --git a/swfdec/jpeg/jpeg.c b/swfdec/jpeg/jpeg.c index d49f418..ef1adc8 100644 --- a/swfdec/jpeg/jpeg.c +++ b/swfdec/jpeg/jpeg.c @@ -186,7 +186,9 @@ jpeg_decoder_init_decoder (JpegDecoder *dec) (dec->height_blocks * 8 * max_v_sample / dec->components[i].v_subsample); dec->components[i].rowstride = rowstride; - dec->components[i].image = malloc (image_size); + dec->components[i].image = g_try_malloc (image_size); + if (!dec->components[i].image) + dec->error = TRUE; } }