Opened 2 years ago

Closed 2 years ago

#5487 closed defect (fixed)

mjpeg2jpeg bitstream filter causes segmentation fault with header-less mjpeg

Reported by: thebombzen Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: mjpeg2jpeg crash regression
Cc: jsebechlebsky Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: Attempting to filter a raw mjpeg file with headerless frames with the mjpeg2jpeg bitstream filter causes a segmentation fault. The file plays fine in ffplay, and it works if you remove the -bsf argument.
How to reproduce:

./ffmpeg -report -v 9 -loglevel 99 -i mjpeg2jpeg_bsf_error.mjpeg -c copy -bsf mjpeg2jpeg test.mjpeg
ffmpeg version N-79688-g3cb3ddd Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
  configuration: 
  libavutil      55. 23.100 / 55. 23.100
  libavcodec     57. 38.100 / 57. 38.100
  libavformat    57. 34.103 / 57. 34.103
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 44.100 /  6. 44.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'mjpeg2jpeg_bsf_error.mjpeg'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-bsf' ... matched as option 'bsf' (A comma-separated list of bitstream filters) with argument 'mjpeg2jpeg'.
Reading option 'test.mjpeg' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option v (set logging level) with argument 9.
Applying option loglevel (set logging level) with argument 99.
Successfully parsed a group of options.
Parsing a group of options: input file mjpeg2jpeg_bsf_error.mjpeg.
Successfully parsed a group of options.
Opening an input file: mjpeg2jpeg_bsf_error.mjpeg.
[file @ 0x3080480] Setting default whitelist 'file,crypto'
[mjpeg @ 0x307fcc0] Format mjpeg detected only with low score of 25, misdetection possible!
[mjpeg @ 0x307fcc0] Before avformat_find_stream_info() pos: 0 bytes read:1048576 seeks:0
[mjpeg @ 0x3081320] marker=d8 avail_size_in_buf=264832
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=db avail_size_in_buf=264830
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=c0 avail_size_in_buf=264696
[mjpeg @ 0x3081320] Changing bps from 0 to 8
[mjpeg @ 0x3081320] sof0: picture: 1920x1080
[mjpeg @ 0x3081320] component 0 2:1 id: 0 quant:0
[mjpeg @ 0x3081320] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x3081320] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x3081320] pix fmt id 21111100
[mjpeg @ 0x3081320] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x3081320] marker=dd avail_size_in_buf=264677
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] escaping removed 287 bytes
[mjpeg @ 0x3081320] marker=da avail_size_in_buf=264671
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=262480
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=260471
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=258468
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=256426
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=254442
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=252498
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=250590
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=248684
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=246770
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=244836
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=242977
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=241087
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=239222
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=237238
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=235267
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=233303
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=231311
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=229373
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=227456
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=225532
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=223627
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=221755
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=219848
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=217833
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=215762
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=213727
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=211729
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=209860
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=207976
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=206138
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=204250
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=202390
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=200562
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=198701
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=196831
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=194982
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=193144
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=191300
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=189438
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=187556
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=185702
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=183864
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=181992
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=180147
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=178289
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=176403
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=174510
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=172623
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=170755
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=168906
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=167048
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=165148
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=163269
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=161409
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=159540
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=157636
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=155741
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=153861
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=151978
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=150100
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=148193
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=146303
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=144423
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=142550
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=140646
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=138742
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=136852
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=134957
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=133036
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=131116
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=129216
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=127312
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=125428
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=123482
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=121538
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=119611
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=117674
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=115726
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=113774
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=111822
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=109893
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=107916
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=105968
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=103988
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=102017
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=100073
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=98098
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=96132
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=94089
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=92067
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=90023
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=87982
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=85965
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=83999
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=82038
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=80068
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=78141
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=76215
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=74279
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=72392
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=70454
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=68512
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=66543
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=64633
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=62690
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=60767
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=58850
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=56946
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=54940
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=52977
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=50979
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=48998
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=46992
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=44991
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=42973
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=40986
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=38980
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=36951
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=34935
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=32939
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=30970
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=28886
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=26695
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=24581
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=22320
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=19953
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d6 avail_size_in_buf=17635
[mjpeg @ 0x3081320] restart marker: 6
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d7 avail_size_in_buf=15375
[mjpeg @ 0x3081320] restart marker: 7
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d0 avail_size_in_buf=13039
[mjpeg @ 0x3081320] restart marker: 0
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d1 avail_size_in_buf=10888
[mjpeg @ 0x3081320] restart marker: 1
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d2 avail_size_in_buf=8765
[mjpeg @ 0x3081320] restart marker: 2
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d3 avail_size_in_buf=6580
[mjpeg @ 0x3081320] restart marker: 3
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d4 avail_size_in_buf=4381
[mjpeg @ 0x3081320] restart marker: 4
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d5 avail_size_in_buf=2212
[mjpeg @ 0x3081320] restart marker: 5
[mjpeg @ 0x3081320] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x3081320] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x3081320] decode frame unused 0 bytes
[mjpeg @ 0x307fcc0] All info found
[mjpeg @ 0x307fcc0] After avformat_find_stream_info() pos: 265216 bytes read:1048576 seeks:0 frames:1
Input #0, mjpeg, from 'mjpeg2jpeg_bsf_error.mjpeg':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 1, 1/1200000: Video: mjpeg, 1 reference frame, yuvj422p(pc, bt470bg/unknown/unknown, center), 1920x1080 (0x0), 0/1, 25 fps, 25 tbr, 1200k tbn
Successfully opened the file.
Parsing a group of options: output file test.mjpeg.
Applying option c (codec name) with argument copy.
Applying option bsf (A comma-separated list of bitstream filters) with argument mjpeg2jpeg.
Successfully parsed a group of options.
Opening an output file: test.mjpeg.
[file @ 0x3084860] Setting default whitelist 'file,crypto'
Successfully opened the file.
[mjpeg @ 0x3082e80] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, mjpeg, to 'test.mjpeg':
  Metadata:
    encoder         : Lavf57.34.103
    Stream #0:0, 0, 1/25: Video: mjpeg, 1 reference frame, yuvj422p(center), 1920x1080 (0x0), 0/1, q=2-31, 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[AVBSFContext @ 0x3084900] input is truncated
Segmentation fault

Note that without the -bsf argument, it works.

./ffmpeg -report -v 9 -loglevel 99 -i mjpeg2jpeg_bsf_error.mjpeg -c copy test.mjpeg
ffmpeg version N-79688-g3cb3ddd Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
  configuration: 
  libavutil      55. 23.100 / 55. 23.100
  libavcodec     57. 38.100 / 57. 38.100
  libavformat    57. 34.103 / 57. 34.103
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 44.100 /  6. 44.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input file with argument 'mjpeg2jpeg_bsf_error.mjpeg'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'test.mjpeg' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option v (set logging level) with argument 9.
Applying option loglevel (set logging level) with argument 99.
Successfully parsed a group of options.
Parsing a group of options: input file mjpeg2jpeg_bsf_error.mjpeg.
Successfully parsed a group of options.
Opening an input file: mjpeg2jpeg_bsf_error.mjpeg.
[file @ 0x1e2f460] Setting default whitelist 'file,crypto'
[mjpeg @ 0x1e2eca0] Format mjpeg detected only with low score of 25, misdetection possible!
[mjpeg @ 0x1e2eca0] Before avformat_find_stream_info() pos: 0 bytes read:1048576 seeks:0
[mjpeg @ 0x1e30300] marker=d8 avail_size_in_buf=264832
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=db avail_size_in_buf=264830
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=c0 avail_size_in_buf=264696
[mjpeg @ 0x1e30300] Changing bps from 0 to 8
[mjpeg @ 0x1e30300] sof0: picture: 1920x1080
[mjpeg @ 0x1e30300] component 0 2:1 id: 0 quant:0
[mjpeg @ 0x1e30300] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x1e30300] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x1e30300] pix fmt id 21111100
[mjpeg @ 0x1e30300] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x1e30300] marker=dd avail_size_in_buf=264677
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] escaping removed 287 bytes
[mjpeg @ 0x1e30300] marker=da avail_size_in_buf=264671
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=262480
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=260471
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=258468
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=256426
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=254442
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=252498
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=250590
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=248684
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=246770
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=244836
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=242977
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=241087
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=239222
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=237238
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=235267
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=233303
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=231311
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=229373
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=227456
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=225532
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=223627
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=221755
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=219848
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=217833
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=215762
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=213727
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=211729
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=209860
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=207976
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=206138
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=204250
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=202390
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=200562
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=198701
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=196831
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=194982
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=193144
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=191300
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=189438
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=187556
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=185702
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=183864
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=181992
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=180147
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=178289
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=176403
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=174510
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=172623
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=170755
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=168906
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=167048
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=165148
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=163269
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=161409
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=159540
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=157636
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=155741
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=153861
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=151978
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=150100
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=148193
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=146303
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=144423
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=142550
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=140646
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=138742
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=136852
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=134957
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=133036
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=131116
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=129216
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=127312
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=125428
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=123482
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=121538
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=119611
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=117674
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=115726
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=113774
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=111822
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=109893
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=107916
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=105968
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=103988
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=102017
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=100073
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=98098
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=96132
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=94089
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=92067
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=90023
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=87982
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=85965
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=83999
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=82038
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=80068
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=78141
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=76215
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=74279
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=72392
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=70454
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=68512
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=66543
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=64633
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=62690
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=60767
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=58850
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=56946
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=54940
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=52977
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=50979
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=48998
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=46992
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=44991
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=42973
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=40986
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=38980
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=36951
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=34935
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=32939
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=30970
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=28886
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=26695
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=24581
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=22320
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=19953
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d6 avail_size_in_buf=17635
[mjpeg @ 0x1e30300] restart marker: 6
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d7 avail_size_in_buf=15375
[mjpeg @ 0x1e30300] restart marker: 7
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d0 avail_size_in_buf=13039
[mjpeg @ 0x1e30300] restart marker: 0
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d1 avail_size_in_buf=10888
[mjpeg @ 0x1e30300] restart marker: 1
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d2 avail_size_in_buf=8765
[mjpeg @ 0x1e30300] restart marker: 2
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d3 avail_size_in_buf=6580
[mjpeg @ 0x1e30300] restart marker: 3
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d4 avail_size_in_buf=4381
[mjpeg @ 0x1e30300] restart marker: 4
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d5 avail_size_in_buf=2212
[mjpeg @ 0x1e30300] restart marker: 5
[mjpeg @ 0x1e30300] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x1e30300] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x1e30300] decode frame unused 0 bytes
[mjpeg @ 0x1e2eca0] All info found
[mjpeg @ 0x1e2eca0] After avformat_find_stream_info() pos: 265216 bytes read:1048576 seeks:0 frames:1
Input #0, mjpeg, from 'mjpeg2jpeg_bsf_error.mjpeg':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 1, 1/1200000: Video: mjpeg, 1 reference frame, yuvj422p(pc, bt470bg/unknown/unknown, center), 1920x1080 (0x0), 0/1, 25 fps, 25 tbr, 1200k tbn
Successfully opened the file.
Parsing a group of options: output file test.mjpeg.
Applying option c (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: test.mjpeg.
[file @ 0x1e337c0] Setting default whitelist 'file,crypto'
Successfully opened the file.
[mjpeg @ 0x1e31e60] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, mjpeg, to 'test.mjpeg':
  Metadata:
    encoder         : Lavf57.34.103
    Stream #0:0, 0, 1/25: Video: mjpeg, 1 reference frame, yuvj422p(center), 1920x1080 (0x0), 0/1, q=2-31, 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
No more output streams to write to, finishing.
frame=   28 fps=0.0 q=-1.0 Lsize=    8192kB time=00:00:01.12 bitrate=59918.6kbits/s speed=40.1x    
video:8192kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (mjpeg2jpeg_bsf_error.mjpeg):
  Input stream #0:0 (video): 28 packets read (8388608 bytes); 
  Total: 28 packets (8388608 bytes) demuxed
Output file #0 (test.mjpeg):
  Output stream #0:0 (video): 28 packets muxed (8388608 bytes); 
  Total: 28 packets (8388608 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x1e33600] Statistics: 0 seeks, 271 writeouts
[AVIOContext @ 0x1e37800] Statistics: 8388608 bytes read, 0 seeks

Attachments (1)

mjpeg2jpeg_bsf_error.mjpeg (2.4 MB) - added by thebombzen 2 years ago.
This was captured from a webcam and truncated.

Change History (6)

Changed 2 years ago by thebombzen

This was captured from a webcam and truncated.

comment:1 Changed 2 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Keywords crash regression added; bsf removed
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open

Regression since af9cac1be1750ecc0e12c6788a3aeed1f1a778be

$ valgrind ffmpeg_g -i mjpeg2jpeg_bsf_error.mjpeg -vcodec copy -bsf mjpeg2jpeg -f null -
==4223== Memcheck, a memory error detector
==4223== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==4223== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==4223== Command: ffmpeg_g -i mjpeg2jpeg_bsf_error.mjpeg -vcodec copy -bsf mjpeg2jpeg -f null -
==4223==
ffmpeg version N-79688-g3cb3ddd Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      55. 23.100 / 55. 23.100
  libavcodec     57. 38.100 / 57. 38.100
  libavformat    57. 34.103 / 57. 34.103
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 44.100 /  6. 44.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mjpeg @ 0xb5017e0] Format mjpeg detected only with low score of 25, misdetection possible!
Input #0, mjpeg, from 'mjpeg2jpeg_bsf_error.mjpeg':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 25 fps, 25 tbr, 1200k tbn
[null @ 0xbbd2da0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf57.34.103
    Stream #0:0: Video: mjpeg, yuvj422p, 1920x1080, q=2-31, 25 fps, 25 tbr, 1200k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
==4223== Use of uninitialised value of size 8
==4223==    at 0x9FC36D: mjpeg2jpeg_filter (mjpeg2jpeg_bsf.c:90)
==4223==    by 0x73476B: av_bitstream_filter_filter (bitstream_filter.c:162)
==4223==    by 0x6D91EE: av_apply_bitstream_filters (utils.c:4991)
==4223==    by 0x49317A: write_frame (ffmpeg.c:692)
==4223==    by 0x499658: do_streamcopy (ffmpeg.c:1908)
==4223==    by 0x49B4C7: transcode (ffmpeg.c:2434)
==4223==    by 0x47DC8A: main (ffmpeg.c:4343)
==4223==
[AVBSFContext @ 0xbbd5b00] input is truncated
==4223== Conditional jump or move depends on uninitialised value(s)
==4223==    at 0x726D3C: av_packet_free (avpacket.c:64)
==4223==    by 0x9FC58D: mjpeg2jpeg_filter (mjpeg2jpeg_bsf.c:129)
==4223==    by 0x73476B: av_bitstream_filter_filter (bitstream_filter.c:162)
==4223==    by 0x6D91EE: av_apply_bitstream_filters (utils.c:4991)
==4223==    by 0x49317A: write_frame (ffmpeg.c:692)
==4223==    by 0x499658: do_streamcopy (ffmpeg.c:1908)
==4223==    by 0x49B4C7: transcode (ffmpeg.c:2434)
==4223==    by 0x47DC8A: main (ffmpeg.c:4343)
==4223==
==4223== Use of uninitialised value of size 8
==4223==    at 0x726D42: av_packet_free (avpacket.c:255)
==4223==    by 0x9FC58D: mjpeg2jpeg_filter (mjpeg2jpeg_bsf.c:129)
==4223==    by 0x73476B: av_bitstream_filter_filter (bitstream_filter.c:162)
==4223==    by 0x6D91EE: av_apply_bitstream_filters (utils.c:4991)
==4223==    by 0x49317A: write_frame (ffmpeg.c:692)
==4223==    by 0x499658: do_streamcopy (ffmpeg.c:1908)
==4223==    by 0x49B4C7: transcode (ffmpeg.c:2434)
==4223==    by 0x47DC8A: main (ffmpeg.c:4343)
==4223==
==4223== Use of uninitialised value of size 8
==4223==    at 0x107F033: av_freep (mem.c:247)
==4223==    by 0x726D70: av_packet_free (avpacket.c:257)
==4223==    by 0x9FC58D: mjpeg2jpeg_filter (mjpeg2jpeg_bsf.c:129)
==4223==    by 0x73476B: av_bitstream_filter_filter (bitstream_filter.c:162)
==4223==    by 0x6D91EE: av_apply_bitstream_filters (utils.c:4991)
==4223==    by 0x49317A: write_frame (ffmpeg.c:692)
==4223==    by 0x499658: do_streamcopy (ffmpeg.c:1908)
==4223==    by 0x49B4C7: transcode (ffmpeg.c:2434)
==4223==    by 0x47DC8A: main (ffmpeg.c:4343)
==4223==
==4223==
==4223== Process terminating with default action of signal 11 (SIGSEGV)
==4223==  Bad permissions for mapped region at address 0x728268
==4223==    at 0x107F036: av_freep (mem.c:248)
==4223==    by 0x726D70: av_packet_free (avpacket.c:257)
==4223==    by 0x9FC58D: mjpeg2jpeg_filter (mjpeg2jpeg_bsf.c:129)
==4223==    by 0x73476B: av_bitstream_filter_filter (bitstream_filter.c:162)
==4223==    by 0x6D91EE: av_apply_bitstream_filters (utils.c:4991)
==4223==    by 0x49317A: write_frame (ffmpeg.c:692)
==4223==    by 0x499658: do_streamcopy (ffmpeg.c:1908)
==4223==    by 0x49B4C7: transcode (ffmpeg.c:2434)
==4223==    by 0x47DC8A: main (ffmpeg.c:4343)
==4223==
==4223== HEAP SUMMARY:
==4223==     in use at exit: 1,861,854 bytes in 66 blocks
==4223==   total heap usage: 1,049 allocs, 983 frees, 7,564,761 bytes allocated
==4223==
==4223== LEAK SUMMARY:
==4223==    definitely lost: 0 bytes in 0 blocks
==4223==    indirectly lost: 0 bytes in 0 blocks
==4223==      possibly lost: 0 bytes in 0 blocks
==4223==    still reachable: 1,861,854 bytes in 66 blocks
==4223==         suppressed: 0 bytes in 0 blocks
==4223== Rerun with --leak-check=full to see details of leaked memory
==4223==
==4223== For counts of detected and suppressed errors, rerun with: -v
==4223== Use --track-origins=yes to see where uninitialised values come from
==4223== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 2 from 2)
Segmentation fault

comment:2 Changed 2 years ago by jsebechlebsky

This seems to be caused by missing check for ff_bsf_get_packet success in mjpeg2jpeg_filter function - execution continues even if AVPacket *in pointer was not initialized.

I've already submitted the patch to mailing list.

comment:3 Changed 2 years ago by cehoyos

  • Cc jsebechlebsky added

Please leave the existing ret = ... line unchanged and add a line if (ret < 0)..., this is more readable.

comment:4 Changed 2 years ago by jsebechlebsky

I've resent the patch with the requested change.

comment:5 Changed 2 years ago by jsebechlebsky

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.