From 4601ad769df9a5c4e51a06a75a23c1f8f39595eb Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Thu, 19 Jan 2012 01:34:30 +0100 Subject: [PATCH] ffprobe: fix value_string() prefix printing for values with negative logarithm The index for the binary_unit_prefixes array is expected to be positive, so avoid to use negative indexes for accessing it. --- ffprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffprobe.c b/ffprobe.c index ce4883b3bb..92b0f45ee9 100644 --- a/ffprobe.c +++ b/ffprobe.c @@ -106,7 +106,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv) const char *prefix_string = ""; int l; - if (use_value_prefix) { + if (use_value_prefix && vald > 1) { long long int index; if (uv.unit == unit_byte_str && use_byte_value_binary_prefix) {