mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-03 00:56:54 +00:00
* 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
This commit is contained in:
parent
4c3dff6de5
commit
e2e6cfd021
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user