[FFmpeg-cvslog] lavf/md5enc: Use AV_HASH_MAX_SIZE

James Almer git at videolan.org
Sun Jun 16 01:16:24 CEST 2013


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Jun 15 14:03:37 2013 -0300| [1bb005ce54d113e266f3c78354eb2bca65d5fa35] | committer: James Almer

lavf/md5enc: Use AV_HASH_MAX_SIZE

Also increase the buffer size in write_trailer(), since 128
is not enough anymore

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavformat/md5enc.c  |    8 ++++----
 libavformat/version.h |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/md5enc.c b/libavformat/md5enc.c
index 06c9c41..270d9fb 100644
--- a/libavformat/md5enc.c
+++ b/libavformat/md5enc.c
@@ -35,7 +35,7 @@ struct MD5Context {
 static void md5_finish(struct AVFormatContext *s, char *buf)
 {
     struct MD5Context *c = s->priv_data;
-    uint8_t md5[32];
+    uint8_t md5[AV_HASH_MAX_SIZE];
     int i, offset = strlen(buf);
     int len = av_hash_get_size(c->hash);
     av_assert0(len > 0 && len <= sizeof(md5));
@@ -86,9 +86,9 @@ static int write_packet(struct AVFormatContext *s, AVPacket *pkt)
 static int write_trailer(struct AVFormatContext *s)
 {
     struct MD5Context *c = s->priv_data;
-    char buf[128];
-    av_strlcpy(buf, av_hash_get_name(c->hash), sizeof(buf) - 100);
-    av_strlcat(buf, "=", sizeof(buf) - 100);
+    char buf[256];
+    av_strlcpy(buf, av_hash_get_name(c->hash), sizeof(buf) - 200);
+    av_strlcat(buf, "=", sizeof(buf) - 200);
 
     md5_finish(s, buf);
 
diff --git a/libavformat/version.h b/libavformat/version.h
index 8db210e..6815c0b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 55
 #define LIBAVFORMAT_VERSION_MINOR  8
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MICRO 103
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list