aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <kabi@informatics.muni.cz>2002-11-05 12:06:37 +0000
committerZdenek Kabelac <kabi@informatics.muni.cz>2002-11-05 12:06:37 +0000
commite2e6cfd0216080c44203d8c9baa7a0bbdc45028d (patch)
treeb671bafe0e763951eea836831b26669e843854a7
parent4c3dff6de5cbce264722cebc6e279fbc5809103d (diff)
downloadffmpeg-e2e6cfd0216080c44203d8c9baa7a0bbdc45028d.tar.gz
* allocate slightly more data - so decoders won't be touching memory
out of allocated range (would be 4 bytes enough here ???) Originally committed as revision 1168 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libav/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libav/utils.c b/libav/utils.c
index d7cf658ec3..8a609a9b22 100644
--- a/libav/utils.c
+++ b/libav/utils.c
@@ -147,7 +147,8 @@ AVInputFormat *av_find_input_format(const char *short_name)
*/
int av_new_packet(AVPacket *pkt, int size)
{
- pkt->data = av_malloc(size);
+ int64_t* p;
+ pkt->data = av_malloc(size + 9);
if (!pkt->data)
return AVERROR_NOMEM;
pkt->size = size;
@@ -155,6 +156,8 @@ int av_new_packet(AVPacket *pkt, int size)
pkt->pts = AV_NOPTS_VALUE;
pkt->stream_index = 0;
pkt->flags = 0;
+ p = (int64_t*)&pkt->data[size];
+ *p = 0;
return 0;
}