[FFmpeg-devel] [PATCH] avformat/tee: fix null pointer dereference
Michael Niedermayer
michaelni at gmx.at
Fri Dec 13 13:54:28 CET 2013
Fixes CID1108584
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
libavformat/tee.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavformat/tee.c b/libavformat/tee.c
index 12ea0ea..e672cce 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -397,6 +397,13 @@ static int filter_packet(void *log_ctx, AVPacket *pkt,
&new_pkt.data, &new_pkt.size,
pkt->data, pkt->size,
pkt->flags & AV_PKT_FLAG_KEY);
+ if (ret < 0) {
+ av_log(log_ctx, AV_LOG_ERROR,
+ "Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s\n",
+ bsf_ctx->filter->name, pkt->stream_index, fmt_ctx->filename,
+ avcodec_get_name(enc_ctx->codec_id));
+ }
+
if (ret == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {
if ((ret = av_copy_packet(&new_pkt, pkt)) < 0)
break;
@@ -415,13 +422,6 @@ static int filter_packet(void *log_ctx, AVPacket *pkt,
bsf_ctx = bsf_ctx->next;
}
- if (ret < 0) {
- av_log(log_ctx, AV_LOG_ERROR,
- "Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s\n",
- bsf_ctx->filter->name, pkt->stream_index, fmt_ctx->filename,
- avcodec_get_name(enc_ctx->codec_id));
- }
-
return ret;
}
--
1.7.9.5
More information about the ffmpeg-devel
mailing list