summaryrefslogtreecommitdiff
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-02 01:21:27 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-11-04 23:30:53 +0100
commit441fd1bd7d1110fc5c8291f25e429101bb190bd2 (patch)
tree981270ffca7c624fdca08c29f404ece8eef5235d /libavformat/rmdec.c
parent769ab6b86421aab3936bcef3fe1813875c7a5eb0 (diff)
avformat/rmdec: remove unneeded memset() on packet allocation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 3606b74a6e..0c3ac4e47f 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -817,7 +817,6 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
av_packet_unref(&vst->pkt); //FIXME this should be output.
if ((ret = av_new_packet(&vst->pkt, vst->videobufsize)) < 0)
return ret;
- memset(vst->pkt.data, 0, vst->pkt.size);
vst->videobufpos = 8*vst->slices + 1;
vst->cur_slice = 0;
vst->curpic_num = pic_num;
@@ -849,7 +848,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin
memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices,
vst->videobufpos - 1 - 8*vst->slices);
- pkt->size = vst->videobufpos + 8*(vst->cur_slice - vst->slices);
+ av_shrink_packet(pkt, vst->videobufpos + 8*(vst->cur_slice - vst->slices));
pkt->pts = AV_NOPTS_VALUE;
pkt->pos = vst->pktpos;
vst->slices = 0;