Browse Source

assdec: avoid a possible NULL dereference.

tags/n0.11
Nicolas George 13 years ago
parent
commit
e5dd4ae728
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/assdec.c

+ 4
- 1
libavcodec/assdec.c View File

@@ -41,8 +41,11 @@ static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
int len, size = avpkt->size; int len, size = avpkt->size;


while (size > 0) { while (size > 0) {
int duration;
ASSDialog *dialog = ff_ass_split_dialog(avctx->priv_data, ptr, 0, NULL); ASSDialog *dialog = ff_ass_split_dialog(avctx->priv_data, ptr, 0, NULL);
int duration = dialog->end - dialog->start;
if (!dialog)
return AVERROR_INVALIDDATA;
duration = dialog->end - dialog->start;
len = ff_ass_add_rect(data, ptr, 0, duration, 1); len = ff_ass_add_rect(data, ptr, 0, duration, 1);
if (len < 0) if (len < 0)
return len; return len;


Loading…
Cancel
Save