History

lavf/md5enc: Use AV_HASH_MAX_SIZE

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

James Almer committed 13 years ago

Commit 1bb005c1 parent b6249ac2 files · +5 −5Browse files

Unified · Split

2 files
  1. libavformat/md5enc.c +4 −4
  2. libavformat/version.h +1 −1
libavformat/md5enc.c+4−4
@@ -35,7 +35,7 @@ struct MD5Context { · 34 unmodified lines
35static void md5_finish(struct AVFormatContext *s, char *buf)35static void md5_finish(struct AVFormatContext *s, char *buf)
36{36{
37 struct MD5Context *c = s->priv_data;37 struct MD5Context *c = s->priv_data;
38 uint8_t md5[32];38 uint8_t md5[AV_HASH_MAX_SIZE];
39 int i, offset = strlen(buf);39 int i, offset = strlen(buf);
40 int len = av_hash_get_size(c->hash);40 int len = av_hash_get_size(c->hash);
41 av_assert0(len > 0 && len <= sizeof(md5));41 av_assert0(len > 0 && len <= sizeof(md5));
@@ -86,9 +86,9 @@ static int write_packet(struct AVFormatContext *s, AVPacket *pkt) · 44 unmodified lines
86static int write_trailer(struct AVFormatContext *s)86static int write_trailer(struct AVFormatContext *s)
87{87{
88 struct MD5Context *c = s->priv_data;88 struct MD5Context *c = s->priv_data;
89 char buf[128];89 char buf[256];
90 av_strlcpy(buf, av_hash_get_name(c->hash), sizeof(buf) - 100);90 av_strlcpy(buf, av_hash_get_name(c->hash), sizeof(buf) - 200);
91 av_strlcat(buf, "=", sizeof(buf) - 100);91 av_strlcat(buf, "=", sizeof(buf) - 200);
92 92
93 md5_finish(s, buf);93 md5_finish(s, buf);
94 94
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 31
32#define LIBAVFORMAT_VERSION_MAJOR 5532#define LIBAVFORMAT_VERSION_MAJOR 55
33#define LIBAVFORMAT_VERSION_MINOR 833#define LIBAVFORMAT_VERSION_MINOR 8
34#define LIBAVFORMAT_VERSION_MICRO 10234#define LIBAVFORMAT_VERSION_MICRO 103
35 35
36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
37 LIBAVFORMAT_VERSION_MINOR, \37 LIBAVFORMAT_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t