X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fchomp_bsf.c;h=3ba45f3e06dfff42359f64c491cc9f073cdf4114;hb=c71e1e60305669c225c696dd99f6db5dc550a56a;hp=cc94380535a46b1eeff4bf455b8376193a78145e;hpb=0018f17f233d5a702513b7f83eadff8d15f08883;p=ffmpeg diff --git a/libavcodec/chomp_bsf.c b/libavcodec/chomp_bsf.c index cc94380535a..3ba45f3e06d 100644 --- a/libavcodec/chomp_bsf.c +++ b/libavcodec/chomp_bsf.c @@ -23,20 +23,16 @@ #include "bsf.h" #include "internal.h" -static int chomp_filter(AVBSFContext *ctx, AVPacket *out) +static int chomp_filter(AVBSFContext *ctx, AVPacket *pkt) { - AVPacket *in; int ret; - ret = ff_bsf_get_packet(ctx, &in); + ret = ff_bsf_get_packet_ref(ctx, pkt); if (ret < 0) return ret; - while (in->size > 0 && !in->data[in->size - 1]) - in->size--; - - av_packet_move_ref(out, in); - av_packet_free(&in); + while (pkt->size > 0 && !pkt->data[pkt->size - 1]) + pkt->size--; return 0; }