# HG changeset patch # User superdump # Date 1234144681 0 # Node ID 5a9485bd4421304f5a093760b44da0f3516241e4 # Parent f7442819cacf6271f7b933a9c6fb27c4446e2796 Check that there are subtitle rects to encode in avcodec_encode_subtitle() Patch by Bj«Órn Axelsson ( gecko A acc D umu D se ) diff -r f7442819cacf -r 5a9485bd4421 utils.c --- a/utils.c Mon Feb 09 01:51:36 2009 +0000 +++ b/utils.c Mon Feb 09 01:58:01 2009 +0000 @@ -505,6 +505,8 @@ av_log(avctx, AV_LOG_ERROR, "start_display_time must be 0.\n"); return -1; } + if(sub->num_rects == 0 || !sub->rects) + return -1; ret = avctx->codec->encode(avctx, buf, buf_size, sub); avctx->frame_number++; return ret;