Browse Source

avcodec/mjpeg2jpeg_bsf: Check ff_bsf_get_packet success

This fixes ticket #5487 - mjpeg2jpeg bitstream filter causes
segmentation fault with header-less mjpeg.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1
Jan Sebechlebsky Michael Niedermayer 9 years ago
parent
commit
0ff3489534
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/mjpeg2jpeg_bsf.c

+ 2
- 0
libavcodec/mjpeg2jpeg_bsf.c View File

@@ -86,6 +86,8 @@ static int mjpeg2jpeg_filter(AVBSFContext *ctx, AVPacket *out)
uint8_t *output;

ret = ff_bsf_get_packet(ctx, &in);
if (ret < 0)
return ret;

if (in->size < 12) {
av_log(ctx, AV_LOG_ERROR, "input is truncated\n");


Loading…
Cancel
Save