【问题标题】:Fatal signal 11 (SIGSEGV), code 1, fault addr 0x40 in tid 13934致命信号 11 (SIGSEGV),代码 1,tid 13934 中的故障地址 0x40
【发布时间】:2017-11-05 08:37:17
【问题描述】:

我正在尝试提取歌曲缩略图。但是在提取其中一些之后 仅有的 致命信号 11 (SIGSEGV),代码 1,tid 13934 中的故障地址 0x40 引发此错误。请帮助我或给我另一种解决方案来提取歌曲缩略图。

   Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < arrayList.size(); i++) {
                    Log.i("Number",String.valueOf(i));
                    Bitmap bitmap;
                    byte[] buffer;
                    try {
                        FFmpegMediaMetadataRetriever fFmpegMediaMetadataRetriever = new FFmpegMediaMetadataRetriever();
                        fFmpegMediaMetadataRetriever.setDataSource(arrayList.get(i));
                        buffer = fFmpegMediaMetadataRetriever.getEmbeddedPicture();
                    } catch (RuntimeException e) {
                        buffer = null;
                    }

                    if (buffer != null) {
                        bitmap = resizeBitmap.resizeBitmap(buffer, 100, 100);
                    } else bitmap = null;

                    try {
                        File fos = new File(s + "/MyApp/data/thumbs", "image" + i + ".jpg");
                        if (!fos.exists()) {
                            fos.createNewFile();
                        }

                        if (bitmap != null) {
                            FileOutputStream fileOutputStream = new FileOutputStream(fos);
                            if (!fos.exists()) fos.createNewFile();
                            bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
                            fileOutputStream.close();
                        }

                    } catch (IOException e) {
                        e.printStackTrace();
                    }

                }
            }
        });

【问题讨论】:

    标签: java android layout


    【解决方案1】:

    在大多数情况下,您会收到此信号错误,因为您的图像格式与您的解码器不匹配。确保使用正确的方法来解码“/MyApp/data/thumbs/image”。例如,了解您的图像是 yuv 还是 jpeg。

    【讨论】:

      猜你喜欢
      • 2017-01-05
      • 2018-03-29
      • 2016-05-17
      • 1970-01-01
      • 1970-01-01
      • 2023-03-30
      • 2021-11-01
      • 2019-03-05
      • 2016-09-25
      相关资源
      最近更新 更多