[FFmpeg-cvslog] avfilter/vf_uspp: Check for encoding failure

Michael Niedermayer git at videolan.org
Wed Jul 13 20:32:03 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 13 20:16:27 2016 +0200| [e879819e7b271e08cfdea9cbcf0f879b04bd09c3] | committer: Michael Niedermayer

avfilter/vf_uspp: Check for encoding failure

Fixes CID1363015

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e879819e7b271e08cfdea9cbcf0f879b04bd09c3
---

 libavfilter/vf_uspp.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_uspp.c b/libavfilter/vf_uspp.c
index f963254..8a6d0fb 100644
--- a/libavfilter/vf_uspp.c
+++ b/libavfilter/vf_uspp.c
@@ -186,6 +186,7 @@ static void filter(USPPContext *p, uint8_t *dst[3], uint8_t *src[3],
 {
     int x, y, i, j;
     const int count = 1<<p->log2_count;
+    int ret;
 
     for (i = 0; i < 3; i++) {
         int is_chroma = !!i;
@@ -249,7 +250,12 @@ static void filter(USPPContext *p, uint8_t *dst[3], uint8_t *src[3],
         p->frame->data[2] = p->src[2] + x1c  + y1c  * p->frame->linesize[2];
         p->frame->format  = p->avctx_enc[i]->pix_fmt;
 
-        avcodec_encode_video2(p->avctx_enc[i], &pkt, p->frame, &got_pkt_ptr);
+        ret = avcodec_encode_video2(p->avctx_enc[i], &pkt, p->frame, &got_pkt_ptr);
+        if (ret < 0) {
+            av_log(p->avctx_enc[i], AV_LOG_ERROR, "Encoding failed\n");
+            continue;
+        }
+
         p->frame_dec = p->avctx_enc[i]->coded_frame;
 
         offset = (BLOCK-x1) + (BLOCK-y1) * p->frame_dec->linesize[0];



More information about the ffmpeg-cvslog mailing list