Browse Source

read_gab2_sub: fix null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 12 years ago
parent
commit
028cc42a16
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/avidec.c

+ 1
- 1
libavformat/avidec.c View File

@@ -817,7 +817,7 @@ static int avi_read_header(AVFormatContext *s)
} }


static int read_gab2_sub(AVStream *st, AVPacket *pkt) { static int read_gab2_sub(AVStream *st, AVPacket *pkt) {
if (!strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data+5) == 2) {
if (pkt->data && !strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data+5) == 2) {
uint8_t desc[256]; uint8_t desc[256];
int score = AVPROBE_SCORE_MAX / 2, ret; int score = AVPROBE_SCORE_MAX / 2, ret;
AVIStream *ast = st->priv_data; AVIStream *ast = st->priv_data;


Loading…
Cancel
Save