History

avcodec/srtdec: Check ff_htmlmarkup_to_ass() return code

Michael Niedermayer committed 9 years ago

Commit 7b94df21 parent 983e3fb1 file · +5 −4Browse files

Unified · Split

libavcodec/srtdec.c+5−4
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 #include "ass.h"
2828 #include "htmlsubtitles.h"
2929
30−static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
30+static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst,
3131 const char *in, int x1, int y1, int x2, int y2)
3232 {
3333 if (x1 >= 0 && y1 >= 0) {
@@ -49,7 +49,7 @@ static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, · 15 unmodified lines
4949 }
5050 }
5151
52− ff_htmlmarkup_to_ass(avctx, dst, in);
52+ return ff_htmlmarkup_to_ass(avctx, dst, in);
5353 }
5454
5555 static int srt_decode_frame(AVCodecContext *avctx,
@@ -74,8 +74,9 @@ static int srt_decode_frame(AVCodecContext *avctx, · 18 unmodified lines
7474
7575 av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED);
7676
77− srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);
78− ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);
77+ ret = srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);
78+ if (ret >= 0)
79+ ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL);
7980 av_bprint_finalize(&buffer, NULL);
8081 if (ret < 0)
8182 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t