Re: [FFmpeg-devel] [PATCH v3 2/2] avcodec/bsf: Forbid packet without payload in av_bsf_send_packet

2016-08-13 Thread Michael Niedermayer
On Tue, Jul 26, 2016 at 12:40:08PM +0200, sebechlebsky...@gmail.com wrote:
> From: Jan Sebechlebsky 
> 
> Signed-off-by: Jan Sebechlebsky 
> ---
>  libavcodec/avcodec.h | 3 ++-
>  libavcodec/bsf.c | 3 +++
>  2 files changed, 5 insertions(+), 1 deletion(-)

applied

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v3 2/2] avcodec/bsf: Forbid packet without payload in av_bsf_send_packet

2016-07-26 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Signed-off-by: Jan Sebechlebsky 
---
 libavcodec/avcodec.h | 3 ++-
 libavcodec/bsf.c | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ca8dba8..36f7935 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -5898,7 +5898,8 @@ int av_bsf_init(AVBSFContext *ctx);
  * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or
  * AVERROR_EOF.
  *
- * @param pkt the packet to filter. The bitstream filter will take ownership of
+ * @param pkt the packet to filter. pkt must contain some payload (i.e data or
+ * side data must be present in pkt). The bitstream filter will take ownership 
of
  * the packet and reset the contents of pkt. pkt is not touched if an error 
occurs.
  * This parameter may be NULL, which signals the end of the stream (i.e. no 
more
  * packets will be sent). That will cause the filter to output any packets it
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 9b9ada7..8e36861 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -21,6 +21,7 @@
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
+#include "libavutil/avassert.h"
 
 #include "avcodec.h"
 #include "bsf.h"
@@ -177,6 +178,8 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
 return 0;
 }
 
+av_assert0(pkt->data || pkt->side_data);
+
 if (ctx->internal->eof) {
 av_log(ctx, AV_LOG_ERROR, "A non-NULL packet sent after an EOF.\n");
 return AVERROR(EINVAL);
-- 
1.9.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel