avcodec/bsf: Check for packet payload when setting BSF EOF flag.
authorJan Sebechlebsky <sebechlebskyjan@gmail.com>
Sun, 23 Apr 2017 00:56:56 +0000 (21:56 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 23 Apr 2017 01:32:24 +0000 (22:32 -0300)
Set BSF EOF flag only if pkt == NULL or both data and
side data are not present in packet.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/bsf.c

index 0f97c25..38b4231 100644 (file)
@@ -174,7 +174,7 @@ int av_bsf_init(AVBSFContext *ctx)
 
 int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
 {
-    if (!pkt) {
+    if (!pkt || (!pkt->data && !pkt->side_data_elems)) {
         ctx->internal->eof = 1;
         return 0;
     }