[Mesa-dev] [PATCH 1/4] intel/aubinator: Allow for the case where the ascii85 decode fails

Kenneth Graunke kenneth at whitecape.org
Wed Dec 27 23:06:38 UTC 2017


On Wednesday, December 27, 2017 12:58:12 PM PST Jason Ekstrand wrote:
> ---
>  src/intel/tools/aubinator_error_decode.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c
> index d6fbfe0..f0c5b5b 100644
> --- a/src/intel/tools/aubinator_error_decode.c
> +++ b/src/intel/tools/aubinator_error_decode.c
> @@ -350,8 +350,10 @@ read_data_file(FILE *file)
>           uint32_t *data = NULL;
>           int count = ascii85_decode(line+1, &data, line[0] == ':');
>           if (count == 0) {
> -            fprintf(stderr, "ASCII85 decode failed.\n");
> -            exit(EXIT_FAILURE);
> +            fprintf(stderr, "ASCII85 decode of %s at 0x%08"PRIx64" failed.\n",
> +                    sections[sect_num].buffer_name,
> +                    sections[sect_num].gtt_offset);
> +            continue;
>           }
>           sections[sect_num].data = data;
>           sections[sect_num].count = count;
> 

What's the rationale, here?  At this point, you've got a malformed file.
What do we gain by supporting invalid file formats?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171227/7d8c6c66/attachment.sig>


More information about the mesa-dev mailing list