gbaconv

A set of tools aimed at GameBoy Advance developers
Log | Files | Refs | README | LICENSE

commit 258f10aced6c85b5900e88d0973809fc7eb0f463
parent 0c5928896b4c3c782cb773b1b88d809ac36032f6
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon, 25 Mar 2019 15:41:17 +0100

Validate array index before attempting to write data.

Diffstat:
Mpcx2gba.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pcx2gba.c b/pcx2gba.c @@ -114,7 +114,8 @@ int main(int argc, char *argv[]) { run_count = current_byte-192; for (run_position = 0; run_position < run_count; run_position++) { - pcx_buffer[offset+run_position] = input_file_buffer[loop+1]; + if (offset + run_position < pcx_buffer_size) + pcx_buffer[offset + run_position] = input_file_buffer[loop +1]; } offset += run_count; loop += 2;