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

Stefano Sabatini git at videolan.org
Fri Jan 20 13:38:29 CET 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Jan 19 01:34:30 2012 +0100| [4601ad769df9a5c4e51a06a75a23c1f8f39595eb] | committer: Stefano Sabatini

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4601ad769df9a5c4e51a06a75a23c1f8f39595eb
---

 ffprobe.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index ce4883b..92b0f45 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) {



More information about the ffmpeg-cvslog mailing list