summaryrefslogtreecommitdiff
path: root/libavcodec/dvbsubdec.c
diff options
context:
space:
mode:
authormrlika <andriy.lysnevych@gmail.com>2014-02-03 14:11:05 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-02-09 17:14:57 +0100
commit36a62979537018a3c1572ede96dce6316b7daf5d (patch)
tree705b41b121c77fcc6ea330dabf4e60831cbea21e /libavcodec/dvbsubdec.c
parentef5d32b9c5313a1e4491d7f647deae5cb76ca4b0 (diff)
avcodec/dvbsubdec: DVB subtitles decoder: support of 5 bytes extradata format
Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvbsubdec.c')
-rw-r--r--libavcodec/dvbsubdec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index 3863a44111..551a1a205c 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -367,11 +367,15 @@ static av_cold int dvbsub_init_decoder(AVCodecContext *avctx)
int i, r, g, b, a = 0;
DVBSubContext *ctx = avctx->priv_data;
- if (!avctx->extradata || avctx->extradata_size != 4) {
- av_log(avctx, AV_LOG_WARNING, "Invalid extradata, subtitle streams may be combined!\n");
+ if (!avctx->extradata || (avctx->extradata_size < 4) || ((avctx->extradata_size % 5 != 0) && (avctx->extradata_size != 4))) {
+ av_log(avctx, AV_LOG_WARNING, "Invalid DVB subtitles stream extradata!\n");
ctx->composition_id = -1;
ctx->ancillary_id = -1;
} else {
+ if (avctx->extradata_size > 5) {
+ av_log(avctx, AV_LOG_WARNING, "Decoding first DVB subtitles sub-stream\n");
+ }
+
ctx->composition_id = AV_RB16(avctx->extradata);
ctx->ancillary_id = AV_RB16(avctx->extradata + 2);
}