[FFmpeg-cvslog] libzvbi-teletextdec: dont ignore memory allocation error silently

Marton Balint git at videolan.org
Mon Nov 11 22:35:29 CET 2013


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Fri Oct 25 21:02:00 2013 +0200| [4947b0624b4f6f56fb8d9da1568441329e9650a1] | committer: Marton Balint

libzvbi-teletextdec: dont ignore memory allocation error silently

Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavcodec/libzvbi-teletextdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c
index b22a87e..9a0deba 100644
--- a/libavcodec/libzvbi-teletextdec.c
+++ b/libavcodec/libzvbi-teletextdec.c
@@ -440,6 +440,8 @@ teletext_decode_frame(AVCodecContext *avctx,
             if (sub->rects) {
                 sub->num_rects = 1;
                 sub->rects[0] = ctx->pages->sub_rect;
+            } else {
+                ret = AVERROR(ENOMEM);
             }
         } else {
             av_log(avctx, AV_LOG_DEBUG, "sending empty sub\n");
@@ -452,7 +454,8 @@ teletext_decode_frame(AVCodecContext *avctx,
             ctx->pages[i] = ctx->pages[i + 1];
         ctx->nb_pages--;
 
-        *data_size = 1;
+        if (ret >= 0)
+            *data_size = 1;
     } else
         *data_size = 0;
 



More information about the ffmpeg-cvslog mailing list