Commit 47f8f0ac authored by kabi's avatar kabi

* allocate slightly more data - so decoders won't be touching memory

  out of allocated range (would be 4 bytes enough here ???)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@1168 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7761373d
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment