[FFmpeg-devel] [PATCH] ffprobe: fix value_string() prefix printing for values with negative logarithm

Stefano Sabatini stefasab at gmail.com
Thu Jan 19 01:54:28 CET 2012


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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index 9aa9e6b..114e699 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) {
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list