summaryrefslogtreecommitdiff
path: root/libavcodec/srtdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-06 01:50:58 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-08 17:02:02 +0200
commit7b94df232a4b76c44e243e618573f8d331a1eb1c (patch)
tree6c565fd779bfddd19b3b1b965045766323e27242 /libavcodec/srtdec.c
parent983e3fbcc5c976db8f3ba6231fca86355a33cb77 (diff)
avcodec/srtdec: Check ff_htmlmarkup_to_ass() return code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/srtdec.c')
-rw-r--r--libavcodec/srtdec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c
index 862ab47645..ecc0801595 100644
--- a/libavcodec/srtdec.c
+++ b/libavcodec/srtdec.c
@@ -27,7 +27,7 @@
#include "ass.h"
#include "htmlsubtitles.h"
-static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
+static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
const char *in, int x1, int y1, int x2, int y2)
{
if (x1 >= 0 && y1 >= 0) {
@@ -49,7 +49,7 @@ static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
}
}
- ff_htmlmarkup_to_ass(avctx, dst, in);
+ return ff_htmlmarkup_to_ass(avctx, dst, in);
}
static int srt_decode_frame(AVCodecContext *avctx,
@@ -74,8 +74,9 @@ static int srt_decode_frame(AVCodecContext *avctx,
av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED);
- srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);
- ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);
+ ret = srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);
+ if (ret >= 0)
+ ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);
av_bprint_finalize(&buffer, NULL);
if (ret < 0)
return ret;