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
3535 static void md5_finish(struct AVFormatContext *s, char *buf)
3636 {
3737 struct MD5Context *c = s->priv_data;
38− uint8_t md5[32];
38+ uint8_t md5[AV_HASH_MAX_SIZE];
3939 int i, offset = strlen(buf);
4040 int len = av_hash_get_size(c->hash);
4141 av_assert0(len > 0 && len <= sizeof(md5));
@@ -86,9 +86,9 @@ static int write_packet(struct AVFormatContext *s, AVPacket *pkt) · 44 unmodified lines
8686 static int write_trailer(struct AVFormatContext *s)
8787 {
8888 struct MD5Context *c = s->priv_data;
89− char buf[128];
90− av_strlcpy(buf, av_hash_get_name(c->hash), sizeof(buf) - 100);
91− av_strlcat(buf, "=", sizeof(buf) - 100);
89+ char buf[256];
90+ av_strlcpy(buf, av_hash_get_name(c->hash), sizeof(buf) - 200);
91+ av_strlcat(buf, "=", sizeof(buf) - 200);
9292
9393 md5_finish(s, buf);
9494
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131
3232 #define LIBAVFORMAT_VERSION_MAJOR 55
3333 #define LIBAVFORMAT_VERSION_MINOR 8
34−#define LIBAVFORMAT_VERSION_MICRO 102
34+#define LIBAVFORMAT_VERSION_MICRO 103
3535
3636 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3737 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