summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-12-01 23:42:11 +0100
committerJanne Grunau <janne-libav@jannau.net>2012-12-05 00:02:43 +0100
commit54c7fe6d68444cc3c5d4fdda2f2126ed79eac855 (patch)
tree26da4142b5c700c7367404b1193bf078f6d95b72 /libavformat
parentdf9b9567518f2840d79a4a96b447ebe1aa326408 (diff)
downloadffmpeg-streaming-54c7fe6d68444cc3c5d4fdda2f2126ed79eac855.zip
ffmpeg-streaming-54c7fe6d68444cc3c5d4fdda2f2126ed79eac855.tar.gz
raw demuxer: initialize end of partial packets
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rawdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index 1c9aabd..5e95d10 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -45,6 +45,10 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) {
av_free_packet(pkt);
return ret;
+ } else if (ret < size) {
+ /* initialize end of packet for partial reads to avoid reading
+ * uninitialized data on allowed overreads */
+ memset(pkt->data + ret, 0, FF_INPUT_BUFFER_PADDING_SIZE);
}
pkt->size = ret;
return ret;
OpenPOWER on IntegriCloud