2008-03-31 Bean <bean123ch@gmail.com>

* video/reader/png.c (grub_png_data): New member is_16bit and
	image_data.
	(grub_png_decode_image_header): Detect 16 bit png image.
	(grub_png_convert_image): New function to convert 16 bit image to 8 bit.
	(grub_png_decode_png): Call grub_png_convert_image for 16 bit image.
	(grub_video_reader_png): Release memory occupied by image_data.

	* fs/ntfs.c (find_attr): Handle non-resident attribute list larger than
	4096 bytes.
	(grub_nfs_mount): Skip the test for sector per cluster.

	* include/grub/ntfs.h (MAX_SPC): Removed.
This commit is contained in:
bean 2008-03-31 12:00:48 +00:00
parent 86cb4f54b4
commit a33224e04b
4 changed files with 66 additions and 15 deletions

View file

@ -176,17 +176,15 @@ find_attr (struct grub_ntfs_attr *at, unsigned char attr)
pa = at->attr_end;
if (pa[8])
{
if (u32at (pa, 0x28) > 4096)
{
grub_error (GRUB_ERR_BAD_FS,
"Non-resident attribute list too large");
return NULL;
}
int n;
n = ((u32at (pa, 0x30) + GRUB_DISK_SECTOR_SIZE - 1)
& (~(GRUB_DISK_SECTOR_SIZE - 1)));
at->attr_cur = at->attr_end;
at->edat_buf = grub_malloc (u32at (pa, 0x28));
at->edat_buf = grub_malloc (n);
if (!at->edat_buf)
return NULL;
if (read_data (at, pa, at->edat_buf, 0, u32at (pa, 0x28), 0, 0))
if (read_data (at, pa, at->edat_buf, 0, n, 0, 0))
{
grub_error (GRUB_ERR_BAD_FS,
"Fail to read non-resident attribute list");
@ -818,8 +816,7 @@ grub_ntfs_mount (grub_disk_t disk)
data->mft_start = grub_le_to_cpu64 (bpb.mft_lcn) * data->spc;
if ((data->mft_size > MAX_MFT) || (data->idx_size > MAX_IDX) ||
(data->spc > MAX_SPC) || (data->spc > data->idx_size))
if ((data->mft_size > MAX_MFT) || (data->idx_size > MAX_IDX))
goto fail;
data->mmft.data = data;