avtools/avconv_hw.c:288: error: Null Dereference
  pointer `config` last assigned on line 285 could be null and is dereferenced at line 288, column 15.

avtools/avconv_hw.c:279:1: start of procedure hw_device_match_by_codec()
277. }
278. 
279. static HWDevice *hw_device_match_by_codec(const AVCodec *codec)
     ^
280. {
281.     const AVCodecHWConfig *config;

avtools/avconv_hw.c:284:10: 
282.     HWDevice *dev;
283.     int i;
284.     for (i = 0;; i++) {
              ^
285.         config = avcodec_get_hw_config(codec, i);
286.         if (!config)

avtools/avconv_hw.c:284:14: Loop condition is true. Entering loop body
282.     HWDevice *dev;
283.     int i;
284.     for (i = 0;; i++) {
                  ^
285.         config = avcodec_get_hw_config(codec, i);
286.         if (!config)

avtools/avconv_hw.c:285:9: 
283.     int i;
284.     for (i = 0;; i++) {
285.         config = avcodec_get_hw_config(codec, i);
             ^
286.         if (!config)
287.             return NULL;

libavcodec/utils.c:1346:1: start of procedure avcodec_get_hw_config()
  1344. }
  1345. 
  1346. const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index)
        ^
  1347. {
  1348.     int i;

libavcodec/utils.c:1349:10: Taking false branch
  1347. {
  1348.     int i;
  1349.     if (!codec->hw_configs || index < 0)
                 ^
  1350.         return NULL;
  1351.     for (i = 0; i <= index; i++)

libavcodec/utils.c:1349:31: Taking false branch
  1347. {
  1348.     int i;
  1349.     if (!codec->hw_configs || index < 0)
                                      ^
  1350.         return NULL;
  1351.     for (i = 0; i <= index; i++)

libavcodec/utils.c:1351:10: 
  1349.     if (!codec->hw_configs || index < 0)
  1350.         return NULL;
  1351.     for (i = 0; i <= index; i++)
                 ^
  1352.         if (!codec->hw_configs[i])
  1353.             return NULL;

libavcodec/utils.c:1351:17: Loop condition is true. Entering loop body
  1349.     if (!codec->hw_configs || index < 0)
  1350.         return NULL;
  1351.     for (i = 0; i <= index; i++)
                        ^
  1352.         if (!codec->hw_configs[i])
  1353.             return NULL;

libavcodec/utils.c:1352:14: Taking false branch
  1350.         return NULL;
  1351.     for (i = 0; i <= index; i++)
  1352.         if (!codec->hw_configs[i])
                     ^
  1353.             return NULL;
  1354.     return &codec->hw_configs[index]->public;

libavcodec/utils.c:1351:29: 
  1349.     if (!codec->hw_configs || index < 0)
  1350.         return NULL;
  1351.     for (i = 0; i <= index; i++)
                                    ^
  1352.         if (!codec->hw_configs[i])
  1353.             return NULL;

libavcodec/utils.c:1351:17: Loop condition is false. Leaving loop
  1349.     if (!codec->hw_configs || index < 0)
  1350.         return NULL;
  1351.     for (i = 0; i <= index; i++)
                        ^
  1352.         if (!codec->hw_configs[i])
  1353.             return NULL;

libavcodec/utils.c:1354:5: 
  1352.         if (!codec->hw_configs[i])
  1353.             return NULL;
  1354.     return &codec->hw_configs[index]->public;
            ^
  1355. }
  1356. 

libavcodec/utils.c:1355:1: return from a call to avcodec_get_hw_config
  1353.             return NULL;
  1354.     return &codec->hw_configs[index]->public;
  1355. }
        ^
  1356. 
  1357. #if FF_API_USER_VISIBLE_AVHWACCEL

avtools/avconv_hw.c:286:14: Taking false branch
284.     for (i = 0;; i++) {
285.         config = avcodec_get_hw_config(codec, i);
286.         if (!config)
                  ^
287.             return NULL;
288.         if (!(config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX))

avtools/avconv_hw.c:288:15: 
286.         if (!config)
287.             return NULL;
288.         if (!(config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX))
                   ^
289.             continue;
290.         dev = hw_device_get_by_type(config->device_type);

static HWDevice *hw_device_match_by_codec(const AVCodec *codec)
{
    const AVCodecHWConfig *config;
    HWDevice *dev;
    int i;
    for (i = 0;; i++) {
        config = avcodec_get_hw_config(codec, i);
        if (!config)
            return NULL;
        if (!(config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX))
            continue;
        dev = hw_device_get_by_type(config->device_type);
        if (dev)
            return dev;
    }
}
['static HWDevice *hw_device_match_by_codec(const AVCodec *codec)\n{\n    const AVCodecHWConfig *config;\n    HWDevice *dev;\n    int i;\n    for (i = 0;; i++) {\n        config = avcodec_get_hw_config(codec, i);\n        if (!config)\n            return NULL;\n        if (!(config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX))\n            continue;\n        dev = hw_device_get_by_type(config->device_type);\n        if (dev)\n            return dev;\n    }\n}', 'const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index)\n{\n    int i;\n    if (!codec->hw_configs || index < 0)\n        return NULL;\n    for (i = 0; i <= index; i++)\n        if (!codec->hw_configs[i])\n            return NULL;\n    return &codec->hw_configs[index]->public;\n}']